Skip to main content

Native adapter support for CrewAI with Model Context Protocol (MCP) integration

Project description

CrewAI MCP Adapter

A Python library extending CrewAI's adapter ecosystem with Model Context Protocol (MCP) integration support and comprehensive tooling for custom agent and tool development.

Features

  • 🔌 Native CrewAI integration and adapter patterns
  • 🛠️ MCP protocol support for tool integration
  • 🧩 Easy-to-use interface for extending and creating new adapters
  • 📝 Type-safe implementation with Pydantic
  • 🔍 JSON Schema validation for tool parameters
  • 🚀 Async/await support
  • 📊 Detailed execution metadata

Installation

You can install the package directly from PyPI:

pip install crewai-adapters

Or install from source:

pip install git+https://github.com/dshivendra/crewai_mcp_adapter.git

Quick Start

from crewai import Agent, Task
from crewai_adapters import CrewAIAdapterClient
from crewai_adapters.types import AdapterConfig

async def main():
    async with CrewAIAdapterClient() as client:
        # Connect to MCP server
        await client.connect_to_mcp_server(
            "math",
            command="python",
            args=["math_server.py"]
        )

        # Create agent with tools
        agent = Agent(
            name="Calculator",
            goal="Perform calculations",
            tools=client.get_tools()
        )

        # Execute task
        task = Task(
            description="Calculate (3 + 5) × 12",
            agent=agent
        )
        result = await task.execute()
        print(f"Result: {result}")

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

Documentation

For detailed documentation, see:

Development

Prerequisites

  • Python 3.11 or higher
  • crewai package
  • pydantic package
  • mcp package

Install Development Dependencies

pip install -e ".[test,docs]"

Running Tests

pytest tests/ -v

Publishing

To publish a new version to PyPI:

  1. Update version in pyproject.toml
  2. Build the package:
    python -m build
    
  3. Upload to PyPI:
    python -m twine upload dist/*
    

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

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

Source Distribution

mseep_crewai_adapters-0.1.2.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

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

mseep_crewai_adapters-0.1.2-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file mseep_crewai_adapters-0.1.2.tar.gz.

File metadata

  • Download URL: mseep_crewai_adapters-0.1.2.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for mseep_crewai_adapters-0.1.2.tar.gz
Algorithm Hash digest
SHA256 673e9e81ed616a883a23c5a65df2f93092503cd33665e8ef6fcbc43672a69ad2
MD5 a95ee6d6e57759151520f30cbbed3561
BLAKE2b-256 a85fbb3c5804b67a85489a59887e802b57141813d1796cfc02e21f4693b073ca

See more details on using hashes here.

File details

Details for the file mseep_crewai_adapters-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mseep_crewai_adapters-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ccb8881c1d90fb97dc10189346de4156d3aacecb62202ba10bfc0dd1c36d524f
MD5 7edf4080169f54d75cf4df51c60ab31e
BLAKE2b-256 fec326a07e02142ea00e88bbfdb98a7753a3635ecda043e73a7348036aee05a0

See more details on using hashes here.

Supported by

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