自动引用服务

Hatch-MCP-Server是一个围绕FastMCP服务器的封装工具,为MCP(模型上下文协议)应用添加自动引用功能,以增强科学透明性和归属标注。

  • by CrackingShells
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 crackingshells/hatch-mcp-server

使用说明

赫氏MCP服务器

围绕FastMCP服务器的包装器,为MCP(模型上下文协议)应用程序中的科学透明度和归因添加了自动引用功能。

什么是HatchMCP?

HatchMCP通过自动将引文信息作为标准化的MCP资源公开来增强FastMCP服务器。这使得原始研究/算法和MCP服务器实现都能正确归因,这对于科学计算和自主代理系统中的归因至关重要。

主要特点:

  • 🔬 科学归因:自动引文资源注册
  • 🔄 FastMCP兼容性:适用于现有的FastMCP服务器
  • 📋 标准化URI:用途 citation://origin/ 和 citation://mcp/ 方案
  • 🪶 轻量级:开销最小,无需配置

快速开始

安装

# Install directly from the repository
pip install git+https://github.com/CrackingShells/Hatch-MCP-Server.git

# Or install local copy
git clone https://github.com/CrackingShells/Hatch-MCP-Server.git
cd Hatch-MCP-Server
pip install .

基本用法

from hatch_mcp_server import HatchMCP

# Create an MCP server with citation capabilities
hatch_mcp = HatchMCP(
    name="MyServer",
    origin_citation="Smith, J. 'Original Algorithm', Nature, 2024",
    mcp_citation="Your Name, 'MCP Implementation', GitHub, 2024"
)

# Add tools using FastMCP decorator syntax
@hatch_mcp.server.tool()
def process_data(data: str) -> str:
    """Process data using the wrapped algorithm."""
    hatch_mcp.logger.info(f"Processing: {data}")
    return f"Processed: {data}"

# Run the server
if __name__ == "__main__":
    hatch_mcp.server.run()

现有FastMCP服务器

假设您有一个现有的FastMCP服务器(mcp_server.py)

from mcp.server.fastmcp import FastMCP

existing_server = FastMCP("my_existing_server")

@existing_server.tool()
def existing_function(data: str) -> str:
    return f"Existing: {data}"

你可以用HatchMCP包装它:

from mcp.server.fastmcp import FastMCP
from hatch_mcp_server import HatchMCP

from mcp_server import existing_server

# Wrap with HatchMCP for citation capabilities
hatch_mcp = HatchMCP(
    name="my_existing_server",
    fast_mcp=existing_server,
    origin_citation="Original work citation",
    mcp_citation="MCP implementation citation"
)

# Run the server
if __name__ == "__main__":
    hatch_mcp.server.run()

服务器通过以下方式自动公开引文信息:

  • citation://origin/MyServer -原始算法引用
  • citation://mcp/MyServer -MCP实施引用

文档

📚 完整的文件 -完整的文档目录和导航指南

快速入门指南

开发人员资源

我想

为什么使用HatchMCP?

科学透明度

# Citation information is automatically available to MCP clients
# citation://origin/ServerName -> "Smith, J. 'Algorithm X', Nature, 2024"
# citation://mcp/ServerName -> "Your Name, 'MCP Implementation', 2024"

零配置

# Just wrap your server - citation resources are registered automatically
hatch_mcp = HatchMCP("server_name", origin_citation="...", mcp_citation="...")
# Use hatch_mcp.server exactly like FastMCP

FastMCP兼容性

# Wrap existing FastMCP servers without changes
existing_server = FastMCP("my_server")
wrapped = HatchMCP("my_server", fast_mcp=existing_server, ...)

贡献

我们欢迎捐款!请参阅我们的综合 贡献指南 了解有关开发工作流程、MCP兼容性要求和编码标准的详细指南。

概述

  1. 分叉和克隆 存储库
  2. 安装依赖项: pip install -e . 和 npm install
  3. 创建要素分支: git checkout -b feat/your-feature
  4. 进行更改 并添加测试
  5. 使用常规提交: npm run commit 用于指导性承诺
  6. 创建pull请求

有关提交格式、测试要求和MCP特定开发指南的完整详细信息,请参阅 贡献指南.

需求

  • python: 3.12+
  • 依赖项: mcp>=1.6.0
  • 兼容性:FastMCP服务器和MCP客户端

许可证

AGPL v3:请参阅 许可证


部分 破解贝壳生态系统: 哈奇! -用于科学MCP服务器的包管理系统。