Skip to main content
Glama

mcp-pyodide

by yonaka15

mcp-피오다이드

모델 컨텍스트 프로토콜(MCP)을 위한 Pyodide 서버 구현입니다. 이 서버는 대규모 언어 모델(LLM)이 MCP 인터페이스를 통해 Python 코드를 실행할 수 있도록 지원합니다.

특징

  • Pyodide를 사용한 LLM을 위한 Python 코드 실행 기능
  • MCP 호환 서버 구현
  • stdio 및 SSE 전송 모드 모두 지원
  • TypeScript로 작성된 강력한 구현
  • 명령줄 도구로 사용 가능

설치

지엑스피1

용법

서버로서

import { runServer } from "mcp-pyodide"; // Start the server runServer().catch((error: unknown) => { console.error("Error starting server:", error); process.exit(1); });

명령줄 도구로

stdio 모드로 시작(기본값):

mcp-pyodide

SSE 모드에서 시작:

mcp-pyodide --sse

SSE 모드

SSE 모드에서 실행할 때 서버는 다음과 같은 엔드포인트를 제공합니다.

  • SSE 연결: http://localhost:3020/sse
  • 메시지 핸들러: http://localhost:3020/messages

클라이언트 연결 예:

const eventSource = new EventSource("http://localhost:3020/sse"); eventSource.onmessage = (event) => { console.log("Received:", JSON.parse(event.data)); };

프로젝트 구조

mcp-pyodide/ ├── src/ │ ├── formatters/ # Data formatting handlers │ ├── handlers/ # Request handlers │ ├── lib/ # Library code │ ├── tools/ # Utility tools │ ├── utils/ # Utility functions │ └── index.ts # Main entry point ├── build/ # Build artifacts ├── pyodide-packages/ # Pyodide-related packages └── package.json

종속성

  • @modelcontextprotocol/sdk : MCP SDK (^1.4.0)
  • pyodide : Python 런타임 환경 (^0.27.1)
  • arktype : 유형 검증 라이브러리 (^2.0.1)
  • express : SSE 지원을 위한 웹 프레임워크
  • cors : SSE 지원을 위한 CORS 미들웨어

개발

요구 사항

  • Node.js 18 이상
  • npm 9 이상

설정

# Clone the repository git clone <repository-url> # Install dependencies npm install # Build npm run build

스크립트

  • npm run build : TypeScript를 컴파일하고 실행 권한을 설정합니다.
  • npm start : stdio 모드로 서버 실행
  • npm run start:sse : SSE 모드로 서버를 실행합니다.

환경 변수

  • PYODIDE_CACHE_DIR : Pyodide 캐시 디렉토리(기본값: "./cache")
  • PYODIDE_DATA_DIR : 마운트된 데이터의 디렉토리(기본값: "./data")
  • PORT : SSE 서버용 포트(기본값: 3020)

특허

MIT

기여하다

  1. 저장소를 포크하세요
  2. 기능 브랜치를 생성합니다( git checkout -b feature/amazing-feature )
  3. 변경 사항을 커밋합니다( git commit -am 'Add some amazing feature' )
  4. 브랜치에 푸시( git push origin feature/amazing-feature )
  5. 풀 리퀘스트 만들기

중요 참고 사항

  • 이 프로젝트는 개발 중이며 API가 변경될 수 있습니다.
  • 생산에 사용하기 전에 철저히 테스트하세요
  • 보안상의 이유로 신뢰할 수 없는 코드를 실행할 때는 주의하십시오.
  • SSE 모드를 사용할 때 필요한 경우 적절한 CORS 구성을 확인하세요.

지원하다

문제와 질문이 있으면 이슈 추적기를 이용하세요.

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

모델 컨텍스트 프로토콜(MCP)을 통해 대규모 언어 모델(LLM)로 Python 코드를 실행하기 위한 Pyodide 서버입니다.

  1. 특징
    1. 설치
      1. 용법
        1. 서버로서
        2. 명령줄 도구로
        3. SSE 모드
      2. 프로젝트 구조
        1. 종속성
          1. 개발
            1. 요구 사항
            2. 설정
            3. 스크립트
          2. 환경 변수
            1. 특허
              1. 기여하다
                1. 중요 참고 사항
                  1. 지원하다

                    Related MCP Servers

                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model Context Protocol server that extracts and analyzes Python code structures, focusing on import/export relationships between files to help LLMs understand code context.
                      Last updated -
                      4
                      Python
                      MIT License
                    • A
                      security
                      F
                      license
                      A
                      quality
                      A Python server implementing the Model Context Protocol to provide customizable prompt templates, resources, and tools that enhance LLM interactions in the continue.dev environment.
                      Last updated -
                      2
                      Python
                    • -
                      security
                      A
                      license
                      -
                      quality
                      Model Context Protocol server to run Python code in a sandbox.
                      Last updated -
                      1,462
                      10,016
                      Python
                      MIT License
                    • A
                      security
                      F
                      license
                      A
                      quality
                      A Model Context Protocol server that allows LLMs to interact with Python environments, execute code, and manage files within a specified working directory.
                      Last updated -
                      9
                      37
                      Python
                      • Linux
                      • Apple

                    View all related MCP servers

                    MCP directory API

                    We provide all the information about MCP servers via our MCP API.

                    curl -X GET 'https://glama.ai/api/mcp/v1/servers/yonaka15/mcp-pyodide'

                    If you have feedback or need assistance with the MCP directory API, please join our Discord server