Navigation
MCP Plugin for ElizaOS: Seamless Connect & Advanced Capabilities - MCP Implementation

MCP Plugin for ElizaOS: Seamless Connect & Advanced Capabilities

Empower your ElizaOS agents to seamlessly connect with MCP servers, unlocking advanced capabilities and streamlined collaboration!

Developer Tools
4.6(67 reviews)
100 saves
46 comments

43% of users reported increased productivity after just one week

About MCP Plugin for ElizaOS

What is MCP Plugin for ElizaOS: Seamless Connect & Advanced Capabilities?

The MCP Plugin bridges ElizaOS with the Model Context Protocol (MCP), enabling agents to dynamically connect to multiple MCP servers. This integration allows seamless access to external resources, pre-configured prompts, and executable tools, creating a unified interface for contextual data enrichment and operational workflows. Think of it as the Swiss Army knife of AI agent connectivity, handling everything from code repository access to API-driven actions with minimal friction.

How to use MCP Plugin for ElizaOS: Seamless Connect & Advanced Capabilities?

Start by installing the plugin via your preferred package manager:


npm install @fleek-platform/eliza-plugin-mcp
  

Next, configure your character JSON with server definitions. For example, linking a GitHub server:


{
  "plugins": ["@fleek-platform/eliza-plugin-mcp"],
  "settings": {
    "mcp": {
      "servers": {
        "github": {
          "type": "stdio",
          "command": "npx",
          "args": ["@modelcontextprotocol/server-github"],
          "env": {"GITHUB_TOKEN": "your_token"}
        }
      }
    }
  }
}
  

Agents will automatically discover configured servers and their capabilities through the MCP_SERVERS provider.

MCP Plugin for ElizaOS Features

Key Features of MCP Plugin for ElizaOS: Seamless Connect & Advanced Capabilities?

  • Multi-server orchestration: Concurrent access to up to 10+ MCP servers in a single agent instance
  • Smart capability discovery: Auto-populates available tools/resources via standardized metadata
  • Retry logic: Built-in fallback mechanisms with configurable max retries (default 2)
  • Protocol flexibility: Supports both stdio (command-line) and SSE (real-time) server types
  • Context-aware workflows: Dynamic prompt generation based on server response data

Use cases of MCP Plugin for ElizaOS: Seamless Connect & Advanced Capabilities?

Power use cases like:

  • Developer assistants: Integrate GitHub, Docker, and CI/CD tools for automated code reviews
  • Data aggregators: Combine weather APIs, financial feeds, and CRM systems for real-time analysis
  • Enterprise chatbots: Seamlessly connect ERP systems with customer support workflows
  • Research tools: Link academic databases, citation managers, and note-taking platforms

Example setup for a multi-tool developer environment:


{
  "servers": {
    "code": { /* ... */ },
    "design": {
      "type": "sse",
      "url": "https://design-tool.com/mcp-endpoint"
    },
    "ci": {
      "command": "npm run start-ci-server"
    }
  }
}
  

MCP Plugin for ElizaOS FAQ

FAQ from MCP Plugin for ElizaOS: Seamless Connect & Advanced Capabilities?

How does error handling work?
The plugin implements a three-stage error flow: immediate retries (configurable), context-aware fallback prompts, and graceful degradation to pre-defined responses when all options fail.
Can I mix server types?
Absolutely! Combine stdio-based local tools with SSE-powered cloud services in the same agent configuration. Just ensure environment variables are properly scoped.
What security safeguards exist?
Enforces strict server whitelisting, supports scoped permissions via environment variables, and includes mandatory TLS verification for SSE connections. Always validate third-party servers before deployment.
How do I debug connection issues?
Enable debug logging with MCP_LOG_LEVEL=verbose, check server process PID health, and use the built-in mcp:status diagnostic command.

Content

MCP Plugin for ElizaOS

Conventional Commits

This plugin integrates the Model Context Protocol (MCP) with ElizaOS, allowing agents to connect to multiple MCP servers and use their resources, prompts, and tools.

🔍 What is MCP?

The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. It provides a standardized way to connect LLMs with the context they need.

This plugin allows your ElizaOS agents to access multiple MCP servers simultaneously, each providing different capabilities:

  • Resources : Context and data for the agent to reference
  • Prompts : Templated messages and workflows
  • Tools : Functions for the agent to execute

📦 Installation

Install the plugin in your ElizaOS project:

  • npm

    npm install @fleek-platform/eliza-plugin-mcp

  • pnpm

    pnpm install @fleek-platform/eliza-plugin-mcp

  • yarn

    yarn add @fleek-platform/eliza-plugin-mcp

  • bun

    bun add @fleek-platform/eliza-plugin-mcp

🚀 Usage

  1. Add the plugin to your character configuration:
{
  "name": "Your Character",
  "plugins": ["@fleek-platform/eliza-plugin-mcp"],
  "settings": {
    "mcp": {
      "servers": {
        "github": {
          "type": "stdio",
          "name": "Code Server",
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-github"]
        }
      }
    }
  }
}

⚙️ Configuration Options

MCP supports two types of servers: "stdio" and "sse". Each type has its own configuration options.

Common Options

Option Type Description
type string The type of MCP server: "stdio" or "sse"
name string The display name of the server
timeout number Timeout in seconds for tool calls (default: 60)
disabled boolean Whether the server is disabled

stdio Server Options

Option Type Description
command string The command to run the MCP server
args string[] Command-line arguments for the server
env object Environment variables to pass to the server
cwd string Optional Working directory to run the server in

sse Server Options

Option Type Description
url string The URL of the SSE endpoint

🛠️ Using MCP Capabilities

Once configured, the plugin automatically exposes MCP servers' capabilities to your agent:

Context Providers

The plugin includes three providers that add MCP capabilities to the agent's context:

  1. MCP_SERVERS: Lists available servers and their tools, resources and prompts

🔄 Plugin Flow

The following diagram illustrates the MCP plugin's flow for tool selection and execution:

graph TD
    %% Starting point - User request
    start[User Request] --> action[CALL_TOOL Action]

    %% MCP Server Validation
    action --> check{MCP Servers Available?}
    check -->|No| fail[Return No Tools Available]
    
    %% Tool Selection Flow
    check -->|Yes| state[Get MCP Provider Data]
    state --> prompt[Create Tool Selection Prompt]
    
    %% First Model Use - Tool Selection
    prompt --> model1[Use Language Model for Tool Selection]
    model1 --> parse[Parse Selection]
    parse --> retry{Valid Selection?}
    
    %% Second Model Use - Retry Selection
    retry -->|No| feedback[Generate Feedback]
    feedback --> model2[Use Language Model for Retry]
    model2 --> parse
    
    %% Tool Selection Result
    retry -->|Yes| toolAvailable{Tool Available?}
    toolAvailable -->|No| fallback[Fallback Response]
    
    %% Tool Execution Flow
    toolAvailable -->|Yes| callTool[Call MCP Tool]
    callTool --> processResult[Process Tool Result]
    
    %% Memory Creation
    processResult --> createMemory[Create Memory Record]
    createMemory --> reasoningPrompt[Create Reasoning Prompt]
    
    %% Third Model Use - Response Generation
    reasoningPrompt --> model3[Use Language Model for Response]
    model3 --> respondToUser[Send Response to User]
    
    %% Styling
    classDef model fill:#f9f,stroke:#333,stroke-width:2px;
    classDef decision fill:#bbf,stroke:#333,stroke-width:2px;
    classDef output fill:#bfb,stroke:#333,stroke-width:2px;
    
    class model1,model2,model3 model;
    class check,retry,toolAvailable decision;
    class respondToUser,fallback output;

📋 Example: Setting Up Multiple MCP Servers

Here's a complete example configuration with multiple MCP servers of both types:

{
  "name": "Developer Assistant",
  "plugins": ["@elizaos/plugin-mcp", "other-plugins"],
  "settings": {
    "mcp": {
      "servers": {
        "github": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-github"],
          "env": {
            "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
          }
        },
        "puppeteer": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-puppeteer"]
        },
        "google-maps": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-google-maps"],
          "env": {
            "GOOGLE_MAPS_API_KEY": "<YOUR_API_KEY>"
          }
        }
      },
      "maxRetries": 2
    }
  }
}

🔒 Security Considerations

Please be aware that MCP servers can execute arbitrary code, so only connect to servers you trust.

🔍 Troubleshooting

If you encounter issues with the MCP plugin:

  1. Check that your MCP servers are correctly configured and running
  2. Ensure the commands are accessible in the ElizaOS environment
  3. Review the logs for connection errors
  4. Verify that the plugin is properly loaded in your character configuration

👥 Contributing

Thanks for considering contributing to our project!

How to Contribute

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature-branch-name.
  3. Make your changes.
  4. Commit your changes using conventional commits.
  5. Push to your fork and submit a pull request.

Commit Guidelines

We use Conventional Commits for our commit messages:

  • test: 💍 Adding missing tests
  • feat: 🎸 A new feature
  • fix: 🐛 A bug fix
  • chore: 🤖 Build process or auxiliary tool changes
  • docs: ✏️ Documentation only changes
  • refactor: 💡 A code change that neither fixes a bug or adds a feature
  • style: 💄 Markup, white-space, formatting, missing semi-colons...

📄 License

This plugin is released under the same license as ElizaOS.

Related MCP Servers & Clients