Skip to main content

Simplified MCP client wrapper for efficient server interactions

Project description

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

✨ 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 more detailed information and advanced usage, please refer to the examples directory.

  • Simple Client: A great starting point for understanding the basic usage of plug_mcp.
  • Simple Server: A simple MCP server implementation.

🗺️ 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 chandragaur@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.

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

plug_mcp-0.1.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

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

plug_mcp-0.1.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file plug_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: plug_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for plug_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9949911a5f4249f8fd207f817f28480d0e23dbaeec23c1134ed56450f6ec58f9
MD5 2e50910f1da084289db1defb3bb80b62
BLAKE2b-256 89b626fec9c4b4ef877a52f09213d800938698c543dd25b2472da1ae3f06b4e8

See more details on using hashes here.

File details

Details for the file plug_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: plug_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for plug_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea6686da45b310ce879aa42f8248d5eb9e6b1ab33927a09702da8b05730e84c3
MD5 727bb7c96444c6a4e69621f0c1bb4dfc
BLAKE2b-256 c4da4ed696cd5e03ad8eed188336cadd4cf8b2dfbcbaa77d124d4170cbc4d6ae

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