Skip to content

Commit 741cb5c

Browse files
minimal z3 MCP server
1 parent f63c9e3 commit 741cb5c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/api/mcp/z3mcp.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# z3mcp.py
2+
from mcp.server.fastmcp import FastMCP
3+
from z3 import *
4+
5+
# Create an MCP server
6+
mcp = FastMCP("Z3 Solver")
7+
8+
9+
# Evaluate SMT commands
10+
@mcp.tool()
11+
def eval(command : str) -> str:
12+
"""Evaluate an SMTLIB2 Command using Z3"""
13+
return Z3_eval_smtlib2_string(main_ctx().ctx, command)
14+
15+
if __name__ == "__main__":
16+
mcp.run()

0 commit comments

Comments
 (0)