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

crewai_adapters-0.1.2.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

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

crewai_adapters-0.1.2-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crewai_adapters-0.1.2.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for crewai_adapters-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b1697f2a9e90bd251d06d14579364ba7f76b6fb9d5d9b17fee0c0c8e491b61d9
MD5 53136c64937ab4c7bf61fd403e2ca0f5
BLAKE2b-256 050f62065c5ab1c064dc7fa0850e4eaed93ae91c6ce17bc75e2f15d046bf0e77

See more details on using hashes here.

Provenance

The following attestation bundles were made for crewai_adapters-0.1.2.tar.gz:

Publisher: publish.yml on dshivendra/crewai_mcp_adapter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for crewai_adapters-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6d8d8a90944502998d76411a89dc60c28dae411382b34baa2b92da8254f569dc
MD5 36c0f4a48aa2aaeacbf815c272ba1854
BLAKE2b-256 e242ddc8f26e1a3084442ef7f183f41b313f4854b3a3aee5d13bbecf70b918a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for crewai_adapters-0.1.2-py3-none-any.whl:

Publisher: publish.yml on dshivendra/crewai_mcp_adapter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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