Skip to main content

plug_mcp: The Missing Connector for AI

plug_mcp is a Python library that provides a simple and efficient way to connect your applications to AI models using the Multi-purpose Cooperative Protocol (MCP). It acts as a wrapper around the mcp library, offering a streamlined client interface for seamless integration with various AI providers and transport protocols.

PyPI version License: MIT Documentation

Table of Contents

✨ Features

  • Simplified Client Interface: A high-level MCPClient for easy interaction with MCP servers.
  • Multi-provider Support: Out-of-the-box support for Anthropic and OpenAI models.
  • Flexible Transports: Connect to servers using STDIO, SSE, or Streamable HTTP.
  • Built-in Guardrails: Protect your application with content filtering, PII masking, and injection detection.
  • Conversation Management: Easily manage conversation history, context, and persistence.
  • Asynchronous by Design: Built with asyncio for high-performance, non-blocking I/O.
  • Extensible: Easily add new LLM providers, transports, or guardrails.

🚀 Getting Started

Installation

pip install plug_mcp

Quick Start

Here's a simple example of how to use plug_mcp to connect to an MCP server and interact with an AI model:

import asyncio
from plug_mcp.client import MCPClient

async def main():
    # Connect to a local server using STDIO
    client = MCPClient(llm_provider="anthropic")
    await client.connect("python examples/simple_server/main.py")

    # Start a conversation
    conversation_id = client.start_conversation()
    print(f"Started conversation: {conversation_id}")

    # Send a message and get a response
    response = await client.query("Hello, world!")
    print(f"AI: {response}")

    # Disconnect from the server
    await client.disconnect()

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

📚 Documentation

For full details on all features and the complete API reference, please visit our documentation site.

The documentation is automatically generated from the main branch and includes:

  • A full Getting Started guide.
  • In-depth tutorials and examples.
  • The complete API Reference.

🗺️ Roadmap

  • Add support for more LLM providers.
  • Implement a more comprehensive test suite.
  • Add more examples and tutorials.
  • Improve documentation and type hinting.

🤝 Contributing

Contributions are welcome! If you'd like to contribute to plug_mcp, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and add tests.
  4. Ensure that the tests pass.
  5. Submit a pull request with a clear description of your changes.

📄 License

plug_mcp is licensed under the MIT License.

⚠️ Disclaimer

This project is under active development and may undergo significant changes.

Code of Conduct

We are committed to providing a welcoming and inclusive environment for everyone. Please read and follow our Code of Conduct.

🛡️ Security

If you discover a security vulnerability, please report it to us by emailing 2796gaurav@gmail.com. We will address all reports promptly.

🌟 Showcase

Have you built something cool with plug_mcp? Written an article or created a video? We'd love to see it! Please open a pull request to add your project to this list.

💬 Support

If you have questions or need help, please open an issue in the issue tracker.

🐍 Supported Python Versions

plug_mcp is tested and supported on the following Python versions:

  • Python 3.8
  • Python 3.9
  • Python 3.10
  • Python 3.11

Metadata

Release files for plug-mcp 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plug-mcp 0.1.2
File Size Uploaded Provenance
plug_mcp-0.1.2.tar.gz 33.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for plug-mcp 0.1.2
File Interpreter ABI Platform
plug_mcp-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 50.6 kB

Release files / plug_mcp-0.1.2.tar.gz

Download URL plug_mcp-0.1.2.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1b3372b23ed87a35ca5341d8e2da3de1ce4def32b82a2445df2a43110de8ab77
BLAKE2b-256 checksum
How to use checksums
6c4a7ac25418c151bad2220c542a9567017bb5e09f70d3f02fb6df71e75ab81a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Release files / plug_mcp-0.1.2-py3-none-any.whl

Download URL plug_mcp-0.1.2-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9632e4f37187ee29f0e75180561c31f4eebfb350dbe575d73592699198559af6
BLAKE2b-256 checksum
How to use checksums
b1e2694a4274a3c9943fe97ab1806bbccd09a54be375c4359b35d53034066191
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Security for plug-mcp 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page