Synapse MCP Server

by susheel
Verified
MIT License
  • Linux
  • Apple

Integrations

  • Enables cloning the source code repository from GitHub for installation and development.

  • Allows installing the Synapse MCP server package directly from PyPI repository.

  • Supports running tests for the Synapse MCP server using the pytest framework.

시냅스 MCP 서버

Synapse 엔티티(데이터 세트, 프로젝트, 폴더, 파일, 테이블)와 해당 주석을 노출하는 MCP(모델 컨텍스트 프로토콜) 서버입니다.

개요

이 서버는 모델 컨텍스트 프로토콜(MCP)을 통해 Synapse 엔터티와 해당 주석에 액세스하는 RESTful API를 제공합니다. 다음을 수행할 수 있습니다.

  • Synapse로 인증
  • ID로 엔터티 검색
  • 엔티티 주석 가져오기
  • 엔티티 자식 가져오기
  • 다양한 기준에 따라 엔터티 쿼리
  • Synapse 테이블 쿼리

설치

지엑스피1

PyPI에서 설치

# Install from PyPI pip install synapse-mcp

용법

서버 시작

python server.py

이렇게 하면 기본 포트(9000)에서 MCP 서버가 시작됩니다.

CLI 사용

# Start the server using the CLI synapse-mcp --host 127.0.0.1 --port 9000 --debug

명령줄 옵션

usage: server.py [-h] [--host HOST] [--port PORT] [--debug] Run the Synapse MCP server options: -h, --help show this help message and exit --host HOST Host to bind to --port PORT Port to listen on --debug Enable debug logging

테스트 실행

# Run all tests with coverage ./run_tests.sh # Or run pytest directly python -m pytest

서버 테스트

python examples/client_example.py

API 엔드포인트

서버 정보

  • GET /info - 서버 정보 가져오기

도구

  • GET /tools - 사용 가능한 도구 나열
  • POST /tools/authenticate - Synapse로 인증
  • POST /tools/get_entity - ID로 엔티티 가져오기
  • POST /tools/get_entity_annotations - 엔티티에 대한 주석 가져오기
  • POST /tools/get_entity_children - 컨테이너 엔티티의 자식 엔티티 가져오기
  • POST /tools/query_entities - 다양한 기준에 따라 엔터티 쿼리
  • POST /tools/query_table - Synapse 테이블 쿼리

자원

  • GET /resources - 사용 가능한 리소스 나열
  • GET /resources/entity/{id} - ID로 엔터티 가져오기
  • GET /resources/entity/{id}/annotations - 엔티티 주석 가져오기
  • GET /resources/entity/{id}/children - 엔터티 자식 가져오기
  • GET /resources/query/entities/{entity_type} - 유형별 엔터티 쿼리
  • GET /resources/query/entities/parent/{parent_id} - 부모 ID로 엔터티 쿼리
  • GET /resources/query/entities/name/{name} - 이름으로 엔터티 쿼리
  • GET /resources/query/table/{id}/{query} - SQL과 유사한 구문으로 테이블 쿼리

예시

입증

서버를 사용하려면 실제 Synapse 자격 증명으로 인증해야 합니다.

import requests # Authenticate with Synapse response = requests.post("http://127.0.0.1:9000/tools/authenticate", json={ "email": "your-synapse-email@example.com", "password": "your-synapse-password" }) result = response.json() print(result) # Alternatively, you can authenticate with an API key response = requests.post("http://127.0.0.1:9000/tools/authenticate", json={ "api_key": "your-synapse-api-key" })

엔티티 얻기

import requests # Get an entity by ID response = requests.get("http://127.0.0.1:9000/resources/entity/syn123456") # Replace with a real Synapse ID entity = response.json() print(entity)

엔터티 주석 가져오기

import requests # Get annotations for an entity response = requests.get("http://127.0.0.1:9000/resources/entity/syn123456/annotations") # Replace with a real Synapse ID annotations = response.json() print(annotations)

엔터티 쿼리

import requests # Query for files in a project response = requests.get("http://127.0.0.1:9000/resources/query/entities/parent/syn123456", params={ # Replace with a real Synapse ID "entity_type": "file" }) files = response.json() print(files)

테이블 쿼리

import requests # Query a table table_id = "syn123456" # Replace with a real Synapse table ID query = "SELECT * FROM syn123456 LIMIT 10" # Replace with a real Synapse table ID response = requests.get(f"http://127.0.0.1:9000/resources/query/table/{table_id}/{query}") table_data = response.json() print(table_data)

Croissant 형식으로 데이터 세트 가져오기

import requests import json # Get public datasets in Croissant format response = requests.get("http://127.0.0.1:9000/resources/croissant/datasets") croissant_data = response.json() # Save to file with open("croissant_metadata.json", "w") as f: json.dump(croissant_data, f, indent=2)

특허

MIT

-
security - not tested
A
license - permissive license
-
quality - not tested

Synapse 엔티티(데이터 세트, 프로젝트, 폴더, 파일, 테이블)와 해당 주석을 노출하는 모델 컨텍스트 프로토콜 서버로, RESTful API를 통해 Synapse 데이터 리소스에 프로그래밍 방식으로 액세스할 수 있습니다.

  1. Overview
    1. Installation
      1. Installing from PyPI
    2. Usage
      1. Starting the Server
      2. Using the CLI
      3. Command-line Options
      4. Running Tests
      5. Testing the Server
    3. API Endpoints
      1. Server Information
      2. Tools
      3. Resources
    4. Examples
      1. Authentication
      2. Getting an Entity
      3. Getting Entity Annotations
      4. Querying Entities
      5. Querying a Table
      6. Getting Datasets in Croissant Format
    5. License
      ID: svgnoean1v