Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

elizaOS MCP Plugin (Python)

A Python implementation of the Model Context Protocol (MCP) client for elizaOS agents.

Installation

pip install elizaos-plugin-mcp

Features

  • Stdio Transport: Connect to MCP servers via stdio (subprocess)
  • HTTP/SSE Transport: Connect to MCP servers via HTTP/SSE
  • Tool Calling: Execute tools from connected MCP servers
  • Resource Reading: Read resources from MCP servers
  • Strong Typing: Full type hints with Pydantic models
  • Fail-Fast Validation: Strict validation with no error swallowing

Usage

import asyncio
from elizaos_plugin_mcp import McpClient, StdioTransport, StdioServerConfig

async def main():
    # Create a stdio transport config
    config = StdioServerConfig(
        command="npx",
        args=["-y", "@modelcontextprotocol/server-memory"]
    )

    async with StdioTransport(config) as transport:
        client = McpClient(transport)
        await client.connect()

        # List available tools
        tools = await client.list_tools()
        for tool in tools:
            print(f"Tool: {tool.name} - {tool.description}")

        # Call a tool
        result = await client.call_tool(
            name="store_memory",
            arguments={"key": "greeting", "value": "Hello, World!"}
        )
        print(f"Result: {result}")

asyncio.run(main())

Configuration

Stdio Transport

from elizaos_plugin_mcp import StdioServerConfig

config = StdioServerConfig(
    command="npx",
    args=["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"],
    env={"NODE_ENV": "production"},
    cwd="/working/dir",
    timeout_ms=60000
)

HTTP/SSE Transport

from elizaos_plugin_mcp import HttpServerConfig

config = HttpServerConfig(
    url="https://mcp-server.example.com/sse",
    timeout_ms=30000
)

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Type checking
mypy elizaos_plugin_mcp

# Linting
ruff check .
ruff format .

License

MIT License - see LICENSE file for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elizaos_plugin_mcp-2.0.0a5.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elizaos_plugin_mcp-2.0.0a5-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file elizaos_plugin_mcp-2.0.0a5.tar.gz.

File metadata

  • Download URL: elizaos_plugin_mcp-2.0.0a5.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for elizaos_plugin_mcp-2.0.0a5.tar.gz
Algorithm Hash digest
SHA256 a1a7a3592eec9322e8c28ffdffdc4d3072c1390404726a4335d1b3ef3815a686
MD5 a4bf58d94ca0d526e9d000d9a6c6b462
BLAKE2b-256 33e19090bf2bcfaddd9fe679cc669f0aefc5caa906d6ed42467237335bbbe55e

See more details on using hashes here.

File details

Details for the file elizaos_plugin_mcp-2.0.0a5-py3-none-any.whl.

File metadata

File hashes

Hashes for elizaos_plugin_mcp-2.0.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 d8f9c2dd7398c7c0229d7c42a0c8b3d67b20f6f1a00b5e82b840a79b72cc783b
MD5 2c0f64071818052e573cef58fdcfbf77
BLAKE2b-256 9eba7e35a4cc254d30f7cd1d498ad882aa19fa0a41ab45b4ac096d5a9de3562b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.0a5 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page