
maximerivest/mcp2py
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
maximerivest/mcp2py는 https://github.com/maximerivest/mcp2py.에서 가져온 MCP 서버 후보입니다.
개요
maximerivest/mcp2py는 https://github.com/maximerivest/mcp2py.에서 가져온 MCP 서버 후보입니다.
개요(AI 번역)
MCP(모델 컨텍스트 프로토콜)는 AI 도구의 신흥 표준입니다. 리소스. 이 표준은 일반 REST API 서버와 호환되지만, 도구, 자원, 프롬프트를 설명하는 추가 메타데이터를 추가합니다. 기계 판독 가능한 방식입니다. 이것은 우리에게 좋은 기회를 제공합니다 이 MCP에 완전하고 자동으로 매핑되는 Python 모듈을 만드세요 서버들입니다. 이 접근법의 가장 큰 장점은 우리가 어떤 것이든 사용할 수 있다는 점입니다 MCP 서버는 네이티브 Python 라이브러리처럼 사용되며, 구성. 이것은 파이썬 소프트웨어를 만드는 것만큼 큰 문제일 수 있습니다 REST API에 매핑되는 개발 키트는 매우 흔하며 꽤 조용했습니다 수동 프로세스입니다. 이제 REST API를 호스팅하는 조직이 있다면 MCP 인터페이스를 제공하면, 자동으로 Python SDK를 생성할 수 있습니다 아무런 노력 없이 해냈어요! 이 모든 게 이해가 안 돼도 걱정하지 마세요. 모든 것을 알지 않고도 mcp2py의 힘을 활용할 수 있습니다 MCP의 세부 사항. 알아야 할 것은 다음과 같습니다: 프로그래밍적으로 웹사이트와 상호작용할 때, 그들은 아마도 API를 가지고 있을 가능성이 큽니다 계속해서 그 API에 MCP 인터페이스가 있을 가능성이 매우 높습니다. 만약 그렇다면, 웹 프로그래밍 전체를 배울 필요가 없습니다
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
mcp2py: Turn any MCP server into a python module
MCP (Model Context Protocol) is an emerging standard for AI tools and resources. The standard is compatible with normal REST API servers, but adds extra metadata to describe tools, resources, and prompts in a machine-readable way. This provides us with a great opportunity to create Python modules that completely and automatically map to these MCP servers. The biggest advantage of this approach is that we can use any MCP server as if it were a native Python library, with zero configuration. This can be quite a big deal as creating Python software development kits that map to REST APIs is extremely common and was quite a manual process. Now, if the organization hosting the REST API also provides an MCP interface, we can automatically generate a Python SDK for it with zero effort! Don’t worry if this is not all clear to you. You can still leverage the power of mcp2py without knowing all the details of MCP. All you need to know is: if you want to programmatically interact with a website, it is likely that they have an API and as time goes on it is very likely that they have an MCP interface for that API. If they do, you don’t have to learn a whole set of web programming skills, you can just use mcp2py to load the MCP server and start calling functions right away as if it were a native Python library!
Another cool thing to note is that servers don’t have to be running remotely. You can (and have) a lot of servers running on your own personal computer right now. This is useful to have different programs, possibly in different programming languages, talking to each other. As apps that you install will more and more open up a small local server on your machine to let LLMs interact with them, you will also be able to leverage mcp2py to interact with these local servers. That could look like Slack opening a server that lets you query your messages. If so, you could then use mcp2py and have a Python module (a library in essence) that lets you query your Slack messages directly from Python. Super powerful!
Overview
Here is a very simple example of using mcp2py to interact with your local filesystem. That is not very useful as you could just use the built-in Python libraries to do that, but it serves as a very simple example to illustrate how mcp2py works. In this snippet of code we use load to both start the MCP server (which is a Node.js server in this case) and connect to it. Once connected we can call the list_directory tool as if it were a native Python function:
from mcp2py import load
fstools = load("npx -y @modelcontextprotocol/server-filesystem /home")
fstools.list_directory("/home")
[DIR] maxime
This is similar to using the os library in Python:
import os
os.listdir("/home")
['maxime']
The main difference is that instead of going directly from Python to the system, we send commands to a local Node (JavaScript) server and that
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →