Token导航 LogoToken导航TokenDH.com
Easy MCP Langchain logo
开发工具stdio官方级别未说明来源级核验

Easy MCP Langchain

MCP Server

Easy MCP 是一个简化MCP服务集成的工具,提供自动资源管理和零侵入集成功能,支持多种MCP服务,如高德地图、天气API等,适用于需要快速集成MCP服务的开发场景。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
开发工具Python命令行工具

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Annyfee

提供方

Annyfee

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install easy-mcp

详细介绍

🚀 Easy MCP - Make MCP Tools as Simple as Local Functions

Integrate any MCP service with one line of code Automatic management of sub process lifecycle · Zero configuration access to LangChain/LangGraph Agent

✨ feature

  • Automatic Resource ManagementNo need to manually start/stop MCP service
  • Zero intrusion integration: Return to the standard LangChain Tool list
  • Multi service supportHigh tech map, weather, and database MCP one-time access
  • Production availableException safe, child process isolation, asynchronous non blocking

🚀 Quick Start

1. Installation

pip install easy-mcp

two 🧪 Call Gaode Map MCP with "5-line code"

from src.easy_mcp import MCPToolLoader
import asyncio

async def main():
    async with MCPToolLoader([{
        "command": "npx",
        "args": ["-y", "@amap/amap-maps-mcp-server"],
        "env": {"AMAP_MAPS_API_KEY": "你的密钥"}
    }]) as tools:
        search = next(t for t in tools if t.name == "maps_text_search")
        print(await search.ainvoke({"keywords": "西湖", "city": "杭州"}))

asyncio.run(main())

Output Example

{
  "pois": [
    {"name": "杭州西湖", "location": "120.1551,30.2741", ...}
  ]
}

🤖 Building MCP Powered Agent

from langgraph.graph import StateGraph
from src.easy_mcp import MCPToolLoader

async with MCPToolLoader([高德配置]) as tools:
    graph = StateGraph(MessagesState)
    graph.add_node("agent", create_agent_node(tools))
    # ... 添加更多工具结点 ...
    app = graph.compile()
    await app.ainvoke({"messages": [("user", "西湖附近有什么酒店?")]})

👉 View complete example:examples/full_agent_demo.py

🔧 Supported MCP services

ServiceInstallation CommandRequired Environment Variables
Gaode Mapnpx @amap/amap-maps-mcp-serverAMAP_MAPS_API_KEY
Weather APInpx @weather/mcp-serverWEATHER_API_KEY
Custom MCPAny process that complies with the MCP protocol-

📂 project structure

easy-mcp/
├── examples/
│   ├── quickstart.py          # 5 行上手示例
│   └── full_agent_demo.py     # 完整 LangGraph Agent 示例
├── src/easy_mcp/
│   ├── __init__.py            # 导出 MCPToolLoader
│   ├── bridge.py              # MCP ↔ LangChain 适配器
│   └── client.py              # MCP 客户端封装
└── README.md

❓ Frequently Asked Questions (FAQ)

Q: How to add a new MCP service?

Just add a new configuration to the list of MCPToolLoader (\[...\]):

{
    "command": "python",
    "args": ["my_mcp_server.py"],
    "env": {"API_KEY": "..."}
}

Q: Will child processes remain?

can't. MCPToolLoader ensures:

  • MCP subprocess automatically exits 100%
  • Do not leave zombie processes behind
  • Can still be safely cleaned under abnormal conditions

目录标签

目录标签

开发工具Python命令行工具MCP工具本地部署自动资源管理零侵入集成多服务支持

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP