Add M7.2 MCP client support with McpStep, CLI commands, and stdio transport
This commit is contained in:
Vendored
+44
@@ -0,0 +1,44 @@
|
||||
"""Small real MCP stdio server used by the client integration tests."""
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
from mcp.server.fastmcp import FastMCP
|
||||
|
||||
|
||||
server = FastMCP("CmdForge MCP test server")
|
||||
|
||||
|
||||
@server.tool()
|
||||
def echo(message: str) -> str:
|
||||
"""Return a message unchanged."""
|
||||
return message
|
||||
|
||||
|
||||
@server.tool()
|
||||
def add(a: int, b: int) -> dict[str, int]:
|
||||
"""Add two integers."""
|
||||
return {"sum": a + b}
|
||||
|
||||
|
||||
@server.tool()
|
||||
def read_env(name: str) -> str:
|
||||
"""Return an environment value, or an empty string if absent."""
|
||||
return os.environ.get(name, "")
|
||||
|
||||
|
||||
@server.tool()
|
||||
def current_directory() -> str:
|
||||
"""Return the server process working directory."""
|
||||
return os.getcwd()
|
||||
|
||||
|
||||
@server.tool()
|
||||
def wait(seconds: float) -> str:
|
||||
"""Block for the requested duration."""
|
||||
time.sleep(seconds)
|
||||
return "done"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
server.run(transport="stdio")
|
||||
Reference in New Issue
Block a user