YM

yonaka15/mcp-schema

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

10 stars 2 forks 품질 43 트렌드 8MIT

모델 Context Protocol (MCP) 스키마의 Rust 포트는 TypeScript로 작성되었습니다.

개요

MCP 클라이언트와 서버를 구축하기위한 Type-safe 정의를 제공하는 모델 Context Protocol (MCP) 스키마의 A. 큰 언어 모델 (LLM) 응용 프로그램 및 외부 데이터 소스 또는 도구 사이에 활성화 할 수있는 개방형 프로토콜입니다. - : 언어 모델에 의해 호출 할 수있는 도구 및 기능 노출 - : AI 시스템과 외부 서비스 사이의 두 방향 상호 작용 - : 모든 프로토콜 메시지 및 데이터 구조에 대한 강력한 타이핑 - : 사용자 정의 도구, 프롬프트 및 리소스 지원 - 빌딩 AI-enhanced 개발 환경 - 외부 도구 액세스와 지능형 채팅 인터페이스 만들기 - 여러 도구 통합으로 사용자 정의 AI 워크플로우 개발 - 데이터베이스, API 및 파일 시스템과 상호 작용하기 위해 LLM을 활성화 이 Rust 구현은 몇 가지 이점을 제공합니다: - : Rust의 강력한 유형 시스템을 사용하여 컴파일 시간에 배치 오류 - : Zero-cost 요약 및 효율적인 메모리 관리 - : 쓰레기 수집없이 메모리 안전 보증 - : 원활한 JSON ...

개요(AI 번역)

A Rust 구현 of the Model Context Protocol (MCP) 스키마, MCP 클라이언트 및 서버를 구축하기위한 유형 안전 정의 제공.

MCP는 무엇입니까?

**Model Context Protocol (MCP)**는 대형 언어 모델(LLM) 애플리케이션과 외부 데이터 소스 또는 도구 사이에 secure, bidirectional를 가능하게 하는 개방형 프로토콜입니다.

키 기능

-Tool 통합: 언어 모델에 의해 호출 될 수있는 도구 및 기능

  • ** 양방향 통신**: AI 시스템과 외부 서비스 간의 2방향 상호 작용 가능
  • Type Safety: 모든 프로토콜 메시지 및 데이터 구조를 위한 강력한 태핑 -Extensible Architecture: 맞춤 도구, 프롬프트 및 리소스 지원

사용 케이스

  • AI-enhanced 개발 환경 구축
  • 외부 도구 액세스와 지능형 채팅 인터페이스 만들기
  • 여러 도구 통합으로 맞춤 AI 워크플로우 개발
  • 데이터베이스, API 및 파일 시스템과 상호 작용하기 위해 LLM을 활성화

왜 Rust?

이 Rust 구현은 몇 가지 이점을 제공합니다:

  • Type Safety: Rust의 강력한 타입 시스템을 사용하여 컴파일시에 오류를 배치

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

mcp-schema

A Rust implementation of the Model Context Protocol (MCP) schema, providing type-safe definitions for building MCP clients and servers.

What is MCP?

Model Context Protocol (MCP) is an open protocol that enables secure, bidirectional communication between Large Language Model (LLM) applications and external data sources or tools.

Key Features

  • Tool Integration: Expose tools and functions that can be called by language models
  • Bidirectional Communication: Enable two-way interaction between AI systems and external services
  • Type Safety: Strong typing for all protocol messages and data structures
  • Extensible Architecture: Support for custom tools, prompts, and resources

Use Cases

  • Building AI-enhanced development environments
  • Creating intelligent chat interfaces with external tool access
  • Developing custom AI workflows with multiple tool integrations
  • Enabling LLMs to interact with databases, APIs, and file systems

Why Rust?

This Rust implementation provides several advantages:

  • Type Safety: Catch errors at compile time with Rust’s strong type system
  • Performance: Zero-cost abstractions and efficient memory management
  • Reliability: Memory safety guarantees without garbage collection
  • Serde Integration: Seamless JSON serialization/deserialization
  • Cross-Platform: Build native MCP servers and clients for any platform

Installation

Add mcp-schema to your project:

cargo add mcp-schema

Or add to your Cargo.toml:

[dependencies]
mcp-schema = "0.2.0"

Usage

Basic Example

use mcp_schema::*;
use serde_json::json;

// Create a tool with annotations
let tool = Tool {
    name: "calculate".to_string(),
    title: Some("Calculator".to_string()),
    description: Some("Perform calculations".to_string()),
    input_schema: json!({
        "type": "object",
        "properties": {
            "expression": {"type": "string"}
        }
    }),
    output_schema: Some(json!({
        "type": "object",
        "properties": {
            "result": {"type": "number"}
        }
    })),
    annotations: Some(ToolAnnotations {
        read_only_hint: Some(true),
        destructive_hint: Some(false),
        idempotent_hint: Some(true),
        open_world_hint: Some(false),
    }),
};

// Handle tool results with structured content
let result = CallToolResult {
    content: vec![
        ContentBlock::Text(TextContent {
            text: "Calculation complete".to_string(),
        })
    ],
    structured_content: Some(json!({
        "result": 42,
        "confidence": 0.95
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →