The MCP Server with LangGraph exposes a RESTful API following the Model Context Protocol (MCP) specification with additional custom endpoints for health checks and metrics.
from langgraph_mcp import MCPClientclient = MCPClient( base_url="http://localhost:8000", api_key="your-token")response = await client.send_message( "Hello, how can you help me?")
Python SDK is coming soon. Use the HTTP API directly for now.
Copy
Ask AI
import { MCPClient } from '@langgraph/mcp-client';const client = new MCPClient({ baseURL: 'http://localhost:8000', apiKey: 'your-token'});const response = await client.sendMessage( 'Hello, how can you help me?');
JavaScript SDK is coming soon. Use fetch/axios for now.
Copy
Ask AI
curl -X POST http://localhost:8000/message \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "Hello, how can you help me?", "context": {} }'
## Maintain conversation contextcontext = {}response1 = await client.send_message( "My name is Alice", context=context)context.update(response1.context)response2 = await client.send_message( "What's my name?", context=context)## Response: "Your name is Alice"