Token导航 LogoToken导航TokenDH.com
Syncable CLI MCP Server logo
开发工具stdio官方级别未说明来源级核验

Syncable CLI MCP Server

MCP Server

一个支持多客户端同步测试的工具,适用于Rust和Python项目的开发与测试。

工具数

0

提示词数

0

GitHub Stars

2

资源数

0
Rust自动化测试开发工具

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

syncable-dev

提供方

syncable-dev

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uv run python -m src.mcp_py_client_rust_server_stdio

详细介绍

本地开发和测试

先决条件

  • 锈蚀1.70+(rustup update)
  • Python 3.8+(用于客户端测试)
  • 紫外线 (brew install uv macOS)

从源头构建

  1. 克隆存储库:
git clone https://github.com/your-org/syncable-cli-mcp-server.git
cd syncable-cli-mcp-server
  1. 构建项目:
# Debug build
cargo build

# Release build
cargo build --release

二进制文件将在以下位置提供:

  • 调试: ./target/debug/mcp-stdio./target/debug/mcp-sse
  • 发布: ./target/release/mcp-stdio./target/release/mcp-sse

测试MCP服务器

  1. 测试生锈部件:
# Run unit tests
cargo test

# Run with logging
RUST_LOG=debug cargo test
  1. 使用Python客户端进行手动测试:

首先,在终端中启动MCP服务器:

# For stdio mode
cargo run --bin mcp-stdio

# For SSE mode (in another terminal)
cargo run --bin mcp-sse

然后在另一个终端中,设置Python环境:

# Setup Python environment
cd mcp-python-server-client

# Create and activate virtual environment using uv
uv venv
source .venv/bin/activate

# Install dependencies
uv pip install -r requirements.txt
# Or use sync if you have a requirements.lock
uv sync

# Test stdio mode
uv run python -m src.mcp_py_client_rust_server_stdio

# Test SSE mode
uv run python src.mcp_py_client_rust_server_sse
  1. 验证可用工具:

服务器应在启动时显示可用工具。您应该看到:

  • about_info
  • 分析扫描
  • 安全扫描
  • 依赖性扫描
  1. 测试每个工具:
# Using stdio mode for example
cargo run --bin mcp-stdio

在另一个终端中:

import asyncio
from mcp.client.session import ClientSession
from mcp.client.stdio import StdioServerParameters, stdio_client

async def test_tools():
    async with stdio_client(
        StdioServerParameters(command="../target/debug/mcp-stdio")
    ) as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()
            
            # Test about_info
            result = await session.call_tool("about_info", {})
            print("About Info:", result)
            
            # Test analysis_scan
            result = await session.call_tool("analysis_scan", 
                {"path": ".", "display": "matrix"})
            print("Analysis Scan:", result)
            
            # Test security_scan
            result = await session.call_tool("security_scan", {"path": "."})
            print("Security Scan:", result)
            
            # Test dependency_scan
            result = await session.call_tool("dependency_scan", {"path": "."})
            print("Dependency Scan:", result)

asyncio.run(test_tools())
  1. 使用LangGraph进行集成测试:
# Install LangGraph dependencies
uv add langgraph openai python-dotenv langchain_mcp_adapters

# Test stdio integration
uv run python -m src.langgraph_stdio_demo

# Test SSE integration
uv run python -m src.langgraph_sse_demo

常见问题与调试

  1. 端口已在使用中 (SSE模式):
lsof -i :8000  # Check if port 8000 is in use
kill -9 
  # Kill the process if needed
  1. 未找到二进制文件 (stdio模式):
  • 确保Python客户端中的二进制路径与您的构建位置匹配
  • 检查 cargo build 成功
  • 验证二进制权限(chmod +x 如果需要)
  1. 启用调试日志记录:
# For Rust server
RUST_LOG=debug cargo run --bin mcp-stdio

# For Python client
uv python -c "import logging; logging.basicConfig(level=logging.DEBUG)"

使用发布plz的自动发布流程

我们使用 释放plz 实现版本控制和发布的自动化。工作流已在中配置 .github/workflows/release-plz.yml.

  1. 设置:
# Install release-plz
cargo install release-plz

# Configure GitHub token
export GITHUB_TOKEN=your_github_token
export CARGO_REGISTRY_TOKEN=your_crates_io_token
  1. 检查发布状态:
# Preview what would be released
release-plz check
  1. 发布过程:
  • 将您的更改推送到 main 分支
  • GitHub Action将自动执行以下操作:

- 更新Cargo.toml中的版本 - 生成变更日志条目 - 创建发布PR或直接发布 - 准备就绪后推到crates.io

  1. 手动释放 (如果需要):
# Create changelog and bump version
release-plz release

# Update changelog only
release-plz update-changelog

手动预发布检查表

在发布到crates.io之前:

  1. 所有测试均通过: cargo test
  2. 代码格式: cargo fmt --all -- --check
  3. 无剪贴警告: cargo clippy -- -D warnings
  4. 最新文档: cargo doc --no-deps
  5. 版本冲突:

- Cargo.toml - 更改日志.md

  1. Python客户端示例工作
  2. 测试了两种传输模式(stdio/SSE)

出版流程

只有在本地测试成功后:

# Login to crates.io
cargo login

# Dry run
cargo publish --dry-run

# Actual publish
cargo publish

目录标签

目录标签

Rust自动化测试开发工具Rust开发本地部署Python测试多客户端同步

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP