This guide explains how to use the MCP servers in the TTA project.
Before using the MCP servers, you need to:
pip install fastmcp mcp
The basic server demonstrates the core concepts of MCP. This server is intended for development and learning purposes only.
python examples/mcp/basic_server.py
This server provides:
The agent tool server exposes tools for interacting with TTA agents. This server is designed for production or prototype use.
python examples/mcp/agent_tool_server.py
This server provides:
The knowledge resource server exposes resources from the TTA knowledge graph. This server is designed for production or prototype use.
python examples/mcp/knowledge_resource_server.py
This server provides:
The agent adapter allows you to expose any TTA agent as an MCP server. This adapter is designed for production or prototype use after customization for your specific agents.
from src.mcp.agent_adapter import create_agent_mcp_server
from src.agents.dynamic_agents import WorldBuildingAgent
# Create your agent
agent = WorldBuildingAgent(...)
# Create an MCP server for the agent
adapter = create_agent_mcp_server(
agent=agent,
server_name="World Building MCP Server",
server_description="MCP server for the World Building Agent"
)
# Run the MCP server
adapter.run()
This will expose the agent’s methods as MCP tools and its data as MCP resources.
For production deployment, you should:
To use your MCP servers with AI assistants through Augment:
Make sure you have Augment installed and configured.
Start your MCP servers in separate terminals:
python examples/mcp/basic_server.py
python examples/mcp/agent_tool_server.py
python examples/mcp/knowledge_resource_server.py
Augment will automatically detect these running MCP servers.
When you interact with an AI assistant through Augment, the assistant will be able to use these MCP servers to access your agents, knowledge graph, and other capabilities.
The AI assistant can then use these servers to perform tasks like:
You can also use MCP servers programmatically in your code:
from mcp.client import MCPClient
# Create an MCP client
client = MCPClient()
# Connect to an MCP server
client.connect("stdio", command=["python", "examples/mcp/basic_server.py"])
# Call a tool
result = client.call_tool("echo", {"message": "Hello, MCP!"})
print(result)
# Read a resource
resource = client.read_resource("info://server")
print(resource)
# Disconnect from the server
client.disconnect()
This allows you to integrate MCP servers into your own applications and workflows.