Skip to main content

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

Project description

MseeP.ai Security Assessment Badge

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.3.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.3-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mseep_crewai_adapters-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 95e736728de2fb7248042e3731f1da499000e53cb032e05b6b07e19f77e149aa
MD5 a7381dee2bcf6f2de7b99f90752df236
BLAKE2b-256 efe14d36c07c625e8ce74a148214c2862bd5b0a00c285c2af3a82ecc5f3c4034

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mseep_crewai_adapters-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 648aefb710e6f08356568693dc386b74a6eb9b617e495fc30875d2bae5330666
MD5 7a58179384d62019f8749c376aadf119
BLAKE2b-256 16070e018113e4086fd2842d708807745cdfe6ea622d0d3ebc715bff38235bdb

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