A modular agentic platform with multi-agent coordination and Model Context Protocol (MCP) integration for connecting AI agents to external tools and services.
- Node.js 18+
- Python 3.8+
- pnpm (recommended) or npm
- Clone and install dependencies:
git clone <repository-url>
cd langchain-agent
pnpm install- Install MCP server dependencies:
cd mcp_servers
pip install -r requirements.txt
cd ..- Set up environment variables:
cp .env.example .env
# Edit .env with your API keys and configuration# Build the project
pnpm run build
# Start the platform with MCP integration
pnpm startThis will start the full AgenticPlatform with:
- Coordinator agent for intelligent routing
- Multiple specialized agents (Oracle, Analyst, Degen)
- MCP plugins for external tools
- Terminal client for interaction
# Run in development mode with hot reload
pnpm run devThe platform includes several pre-configured MCP servers:
Location: mcp_servers/math_server.py
Tools: Basic arithmetic, power, square root, expression evaluation
Manual Testing:
cd mcp_servers
python math_server.py
# Server runs on stdio transport (no manual interaction needed)Location: mcp_servers/task_management_server.py
Tools: Create tasks, list tasks, get statistics, generate suggestions
Manual Testing:
cd mcp_servers
python task_management_server.py
# Server runs on stdio transportLocation: mcp_servers/weather_server.py
Tools: Get weather, forecasts, temperature, alerts
Manual Testing:
cd mcp_servers
python weather_server.py
# Server runs on SSE transport (requires web server)cd mcp_servers
python math_server.py &
python task_management_server.py &cd mcp_servers
python weather_server.py &
# Server will be available at http://localhost:8000/sseYou can test the MCP integration directly:
# Test MCP plugin functionality
pnpm run build
node dist/examples/test_mcp_plugin.js# Build and start
pnpm run build && pnpm startOnce the platform is running, you can interact with it through the terminal client:
"What's the weather in San Francisco?""Search for information about AI trends""Calculate 15 * 23"(via Math MCP)"What is the square root of 144?"(via Math MCP)
"Analyze this startup: [description]""Evaluate the market potential of this project""Create a task: Build a web app"(via Task MCP)"Generate task suggestions for mobile app"(via Task MCP)
"Should I buy this token?""How do I make an onchain transaction?"
"Create a task: Implement user authentication, high priority""Get all tasks""Show project statistics""Complete task 1"
"Calculate 3 + 5""What is 10 to the power of 3?""Calculate the square root of 256""Evaluate expression: (15 + 7) * 3"
The platform automatically routes your requests to the most appropriate agent:
- Oracle: General knowledge, searches, math operations
- Analyst: Financial analysis, startup evaluation, task management
- Degen: Crypto trading, onchain transactions
langchain-agent/
βββ src/
β βββ core/ # Core agent and workflow logic
β βββ plugins/ # Plugin system including MCP
β βββ clients/ # Client interfaces
β βββ config/ # Configuration files
β βββ examples/ # Example implementations
βββ mcp_servers/ # MCP server implementations
β βββ math_server.py # Math operations server
β βββ task_management_server.py # Task management server
β βββ weather_server.py # Weather information server
β βββ requirements.txt # Python dependencies
βββ docs/ # Documentation
βββ dist/ # Compiled JavaScript
import { MCPPluginFactory } from './plugins/MCPPlugin.js';
// Quick setup for common servers
const mathMCP = MCPPluginFactory.createMathPlugin();
const taskMCP = MCPPluginFactory.createTaskManagementPlugin();
const weatherMCP = MCPPluginFactory.createWeatherPlugin();import { MCPPlugin } from './plugins/MCPPlugin.js';
const customMCP = new MCPPlugin({
name: 'my_mcp',
description: 'Custom MCP plugin',
servers: [
{
name: 'my_server',
command: 'python',
args: ['./mcp_servers/my_server.py'],
transport: 'stdio'
}
]
});# Build TypeScript to JavaScript
pnpm run build
# Watch mode for development
pnpm run build -- --watch# MCP plugin examples
node dist/examples/mcp_plugin_example.js
# Test MCP functionality
node dist/examples/test_mcp_plugin.js
# Coordinator agent example
node dist/examples/coordinator_agent.js- Create a new server file:
#!/usr/bin/env python3
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("MyServer")
@mcp.tool()
def my_tool(input: str) -> str:
"""My custom tool."""
return f"Processed: {input}"
if __name__ == "__main__":
mcp.run(transport="stdio")- Add to your plugin configuration:
const customMCP = new MCPPlugin({
name: 'custom_mcp',
servers: [{
name: 'my_server',
command: 'python',
args: ['./mcp_servers/my_server.py'],
transport: 'stdio'
}]
});-
MCP Server Connection Failed
- Ensure Python dependencies are installed:
pip install -r mcp_servers/requirements.txt - Check server file permissions:
chmod +x mcp_servers/*.py - Verify server paths are correct
- Ensure Python dependencies are installed:
-
OpenAI API Quota Exceeded
- Add credits to your OpenAI account
- Or switch to a different model in the configuration
-
Build Errors
- Ensure TypeScript is installed:
pnpm add -g typescript - Clean and rebuild:
rm -rf dist && pnpm run build
- Ensure TypeScript is installed:
Enable debug logging:
# Set debug environment variable
DEBUG=true pnpm startCheck the console output for:
- MCP server connection status
- Tool loading information
- Agent routing decisions
- Error messages
- MCP Plugin Guide - Detailed MCP integration guide
- Agent Configuration - Agent setup and configuration
- Plugin Development - Creating custom plugins
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the ISC License.
For issues and questions:
- Check the troubleshooting section
- Review the documentation
- Open an issue on GitHub
Happy coding with your AI agents! π€β¨