
emillindfors/mcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
MCP (Model Context Protocol) 호환 프로그램을 만들기위한 크레이트
개요
Model Context Protocol (MCP)의 Rust 구현은 외부 컨텍스트 및 리소스에 액세스하기 위해 AI 모델의 표준화 된 방법을 제공합니다. mcp.rs는 AI 애플리케이션과 통합 간의 원활한 통신을 가능하게 하기 위해 설계된 Model Context Protocol의 고성능, Type-safe Rust 구현입니다. 다양한 유형의 리소스(파일, 데이터, API)를 AI 모델에 노출할 수 있는 MCP 서버를 구축하는 강력한 기반을 제공합니다. - : - CLI 도구에 대한 표준 입력 / 출력 (stdio) 운송 - 웹 통합을위한 Server-Sent Events (SSE)가있는 HTTP - 사용자 정의 구현을위한 탁월한 운송 시스템 - : - 파일 시스템 리소스 공급자 - 자원 Templating 지원 - 실시간 자원 업데이트 - 자원 구독 기능 - : - YAML/JSON 구성 파일 - 환경변수 - 명령줄 인수 - 감지 가능한 기본값 - : - 내장 액세스 제어 - 경로 트래버스 보호 - 제한 비율 - CORS 지원 mcp를 추가합니다.
개요(AI 번역)
Model Context Protocol (MCP)의 Rust 구현은 외부 컨텍스트 및 리소스에 액세스하기 위해 AI 모델의 표준화 된 방법을 제공합니다.
퀵스타트
클라이언트
서버
개요
mcp.rs는 AI 애플리케이션과 통합 간의 원활한 통신을 가능하게 하기 위해 설계된 Model Context Protocol의 고성능, Type-safe Rust 구현입니다. 다양한 유형의 리소스(파일, 데이터, API)를 AI 모델에 노출할 수 있는 MCP 서버를 구축하는 강력한 기반을 제공합니다.
특징
-
**Multiple 수송 유형 **:
-
CLI 도구를 위한 표준 입력/출력 (stdio) 수송
-
웹 통합을위한 Server-Sent Events (SSE)가있는 HTTP
-
사용자 정의 구현을위한 Extensible 수송 시스템
-
** 자원 관리**:
-
파일 시스템 리소스 공급자
-
자원 templating 지원
-
실시간 자원 업데이트
-
Resource 구독 기능
-
Flexible Configuration:
-
YAML/JSON 구성 파일
-
환경변수
-
명령줄 인수
-
Sensible 기본값
-
보안:
-
내장 액세스 제어
-
경로 traversal 보호
-
비율 제한
-
CORS 지원
설치
프로젝트 'Cargo’에 mcp.rs를 추가하십시오.
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
mcp.rs
A Rust implementation of the Model Context Protocol (MCP), providing a standardized way for AI models to access external context and resources.
Quickstart
Client
# List resources
cargo run --bin client list-resources
# Read a specific file
cargo run --bin client read-resource -u "file:///path/to/file"
# Use a prompt
cargo run --bin client get-prompt -n "code_review" -a '{"code": "fn main() {}", "language": "rust"}'
# Call a tool
cargo run --bin client -- --server "http://127.0.0.1:3000" call-tool --name "file_system" --args '{\"operation\": \"read_file\", \"path\": \"Config.toml\"}'
# Set log level
cargo run --bin client set-log-level -l "debug"
# Use SSE transport
cargo run --bin client -t sse -s http://localhost:3000 list-resources
Server
# Run with test config
cargo run --bin server -- --config "../servers/test.json"
Overview
mcp.rs is a high-performance, type-safe Rust implementation of the Model Context Protocol, designed to enable seamless communication between AI applications and their integrations. It provides a robust foundation for building MCP servers that can expose various types of resources (files, data, APIs) to AI models.
Features
-
Multiple Transport Types:
- Standard Input/Output (stdio) transport for CLI tools
- HTTP with Server-Sent Events (SSE) for web integrations
- Extensible transport system for custom implementations
-
Resource Management:
- File system resource provider
- Resource templating support
- Real-time resource updates
- Resource subscription capabilities
-
Flexible Configuration:
- YAML/JSON configuration files
- Environment variable overrides
- Command-line arguments
- Sensible defaults
-
Security:
- Built-in access controls
- Path traversal protection
- Rate limiting
- CORS support
Installation
Add mcp.rs to your project’s Cargo.toml:
[dependencies]
mcp = "0.1.0"
Quick Start
- Create a basic MCP server:
use mcp::{McpServer, ServerConfig};
#[tokio::main]
async fn main() -> Result {
// Create server with default configuration
let server = McpServer::new(ServerConfig::default());
// Run the server
server.run().await
}
- Configure via command line:
# Run with stdio transport
mcp-server -t stdio
# Run with SSE transport on port 3000
mcp-server -t sse -p 3000
# Enable debug logging
mcp-server -l debug
- Or use a configuration file:
server:
name: "my-mcp-server"
version: "1.0.0"
transport: sse
port: 3000
resources:
root_path: "./resources"
allowed_schemes:
- file
max_file_size: 10485760
security:
enable_auth: false
allowed_origins:
- "*"
logging:
level: "info"
format: "pretty"
Architecture
mcp.rs follows a modular architecture:
- Transport Layer: Handles communication between clients and servers
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →