A TypeScript library that enables AI agents to leverage MCP (Model Context Protocol) servers for enhanced capabilities. This library integrates with the AI SDK to provide a seamless way to connect to MCP servers and use their tools in AI-powered applications.
- Connect to multiple MCP servers using different transport methods (STDIO, SSE)
- Automatically discover and use tools from MCP servers
- Integrate with AI SDK for text generation with tool usage
- Filter and combine MCP tools with custom tools
- Preconfigured servers for easy initialization
- Auto-configuration support for simplified setup
- Agents can call other agents for specific tasks
- Agent composition - create specialized agents and combine them
- Named agents with descriptions for improved identification
- Auto-initialization of agents (no need to call initialize explicitly)
- Custom tool definitions directly within agent configuration
- Default model support to simplify multi-agent systems
- System prompt integration for specialized behaviors
- Verbose mode for debugging
- Basic agent with MCP tools integration
- Auto handled MCP servers
- Multi-agent workflows
- Function based tool handlers
- Automatic Swagger/OpenAPI to tools conversion (stateless servers simple integration)
- API Server implementation (call your agent on a server)
- Observabilty system
npm install mcp-ai-agentFor a comprehensive example implementation, check out the mcp-ai-agent-example repository.
Here's the most basic way to use AI Agent with preconfigured servers: