Complete API documentation for the LangChain Agent MCP Server.
Production: https://langchain-agent-mcp-server-554655392699.us-central1.run.app
Local: http://localhost:8000
Server information and available endpoints.
Response:
{
"name": "LangChain Agent MCP Server",
"version": "1.0.0",
"status": "running",
"endpoints": {
"manifest": "/mcp/manifest",
"invoke": "/mcp/invoke"
}
}Health check endpoint.
Response:
{
"status": "healthy"
}Returns the MCP manifest declaring available tools.
Response:
{
"name": "langchain-agent-mcp-server",
"version": "1.0.0",
"description": "LangChain Agent MCP Server...",
"tools": [
{
"name": "agent_executor",
"description": "Execute a complex, multi-step reasoning task...",
"inputSchema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The user's query or task"
}
},
"required": ["query"]
}
}
]
}Executes the LangChain agent with a user query.
Request:
{
"tool": "agent_executor",
"arguments": {
"query": "What is the capital of France?"
}
}Success Response (200):
{
"content": [
{
"type": "text",
"text": "The capital of France is Paris."
}
],
"isError": false
}Error Response (400/500):
{
"content": [
{
"type": "text",
"text": "Error message here"
}
],
"isError": true
}Error Codes:
400- Bad Request (missing query, unknown tool)401- Unauthorized (invalid API key)500- Internal Server Error (agent execution failed)
Interactive API documentation (Swagger UI).
Visit: https://langchain-agent-mcp-server-554655392699.us-central1.run.app/docs
If API_KEY environment variable is set, include in requests:
Authorization: Bearer your-api-keyCurrently no rate limiting is implemented. Consider adding rate limiting for production use.
All errors follow the MCP response format:
{
"content": [
{
"type": "text",
"text": "Error description"
}
],
"isError": true
}# Health check
curl https://langchain-agent-mcp-server-554655392699.us-central1.run.app/health
# Get manifest
curl https://langchain-agent-mcp-server-554655392699.us-central1.run.app/mcp/manifest
# Invoke agent
curl -X POST https://langchain-agent-mcp-server-554655392699.us-central1.run.app/mcp/invoke \
-H "Content-Type: application/json" \
-d '{"tool":"agent_executor","arguments":{"query":"What is 2+2?"}}'import requests
url = "https://langchain-agent-mcp-server-554655392699.us-central1.run.app/mcp/invoke"
response = requests.post(
url,
json={
"tool": "agent_executor",
"arguments": {"query": "What is 2+2?"}
}
)
print(response.json())fetch('https://langchain-agent-mcp-server-554655392699.us-central1.run.app/mcp/invoke', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
tool: 'agent_executor',
arguments: { query: 'What is 2+2?' }
})
})
.then(res => res.json())
.then(data => console.log(data));For more examples, see Examples.