
What is easymcp
easymcp is an innovative server solution developed by SecretiveShell, designed as a complete rewrite of the Model Context Protocol (MCP) using Python. It serves as a robust framework allowing AI systems to connect securely with diverse data sources and tools. By utilizing easymcp, AI assistants can access, manage, and interact with real-time information and resources, enhancing their ability to perform complex tasks efficiently. The server facilitates a seamless client-server architecture, providing a universal standard for handling external data, tools, and prompts, making it a versatile choice for developers working with AI integrations.
How to Use easymcp
To get started with easymcp, you first need to install it using a simple command in your terminal:
uv add easymcp
Once installed, you can leverage the high-level API which features a ClientManager
class. This class empowers users to manage multiple MCP servers with ease. Here's a basic usage example illustrating how to initialize the client manager, manage servers, and interact with tools and resources:
- Initialize the Client Manager: Set up your server parameters and initialize them with the manager.
- List and Manage Servers: Easily list, add, or remove servers as needed.
- Interact with Tools and Resources: List available tools, call functions, and access resources. The tools and resources are automatically namespaced, ensuring that operations are streamlined and organized.
Here is a simple Python script snippet to illustrate usage:
import asyncio
from easymcp.client.ClientManager import ClientManager
from easymcp.client.transports.stdio import StdioServerParameters
mgr = ClientManager()
# Define server parameters
searxng = StdioServerParameters(command="uvx", args=["mcp-searxng"])
timeserver = StdioServerParameters(command="uvx", args=["mcp-timeserver"])
servers = {"searxng": searxng, "timeserver": timeserver}
async def main():
await mgr.init(servers=servers) # Initialize manager with servers
print(mgr.list_servers()) # List all servers
await mgr.remove_server("searxng") # Remove a server
await mgr.add_server("searxng", searxng) # Add a server
print(await mgr.list_tools()) # List tools
print(await mgr.call_tool("timeserver.get-current-time", {})) # Call a tool
print(await mgr.list_resources()) # List all resources
print(await mgr.read_resource("mcp-timeserver+datetime://Africa/Algiers/now")) # Read a resource
await asyncio.Future()
asyncio.run(main())
Key Features of easymcp
- Tool/Resource Caching: Automatically caches tools, resources, and prompts, with automatic cache invalidation on updates.
- Parallel Requests: Supports parallel requests to multiple servers, enhancing performance and efficiency.
- Server Lifecycle Management: Provides full lifecycle management of servers, allowing for dynamic addition and removal.
- Namespaced Tools and Resources: Tools and resources are namespaced, eliminating the need for global uniqueness and simplifying routing across multiple hosts.
- Lightweight and Asynchronous: Built on a lightweight asyncio native implementation, ensuring high performance and responsiveness.
The innovative design of easymcp simplifies the process of managing MCP servers and provides a reliable, high-performance solution for developers integrating AI systems with various data sources. Its intuitive API and comprehensive feature set make it an ideal choice for both beginners and experienced developers looking to enhance their AI capabilities.
How to Use
To use the easymcp, follow these steps:
- Visit https://github.com/SecretiveShell/easymcphttps://github.com/Secret...
- Follow the setup instructions to create an account (if required)
- Connect the MCP server to your Claude Desktop application
- Start using easymcp capabilities within your Claude conversations
Additional Information
Created
March 12, 2025
Company
Start building your own MCP Server
Interested in creating your own MCP Server? Check out the official documentation and resources.
Learn More