|
1 | 1 | # Hatch-MCP-Server |
2 | | -The wrapper around MCP server for Hatch-related applications |
| 2 | + |
| 3 | +A wrapper around FastMCP servers that adds automatic citation capabilities for scientific transparency and attribution in MCP (Model Context Protocol) applications. |
| 4 | + |
| 5 | +## What is HatchMCP? |
| 6 | + |
| 7 | +HatchMCP enhances FastMCP servers by automatically exposing citation information as standardized MCP resources. This enables proper attribution for both original research/algorithms and MCP server implementations, which is critical for attribution in scientific computing and autonomous agent systems. |
| 8 | + |
| 9 | +**Key Features:** |
| 10 | + |
| 11 | +- 🔬 **Scientific Attribution**: Automatic citation resource registration |
| 12 | +- 🔄 **FastMCP Compatibility**: Works with existing FastMCP servers |
| 13 | +- 📋 **Standardized URIs**: Uses `citation://origin/` and `citation://mcp/` schemes |
| 14 | +- 🪶 **Lightweight**: Minimal overhead, zero configuration required |
| 15 | + |
| 16 | +## Quick Start |
| 17 | + |
| 18 | +### Installation |
| 19 | + |
| 20 | +```bash |
| 21 | +# Install directly from the repository |
| 22 | +pip install git+https://github.com/CrackingShells/Hatch-MCP-Server.git |
| 23 | + |
| 24 | +# Or install local copy |
| 25 | +git clone https://github.com/CrackingShells/Hatch-MCP-Server.git |
| 26 | +cd Hatch-MCP-Server |
| 27 | +pip install . |
| 28 | +``` |
| 29 | + |
| 30 | +### Basic Usage |
| 31 | + |
| 32 | +```python |
| 33 | +from hatch_mcp_server import HatchMCP |
| 34 | + |
| 35 | +# Create an MCP server with citation capabilities |
| 36 | +hatch_mcp = HatchMCP( |
| 37 | + name="MyServer", |
| 38 | + origin_citation="Smith, J. 'Original Algorithm', Nature, 2024", |
| 39 | + mcp_citation="Your Name, 'MCP Implementation', GitHub, 2024" |
| 40 | +) |
| 41 | + |
| 42 | +# Add tools using FastMCP decorator syntax |
| 43 | +@hatch_mcp.server.tool() |
| 44 | +def process_data(data: str) -> str: |
| 45 | + """Process data using the wrapped algorithm.""" |
| 46 | + hatch_mcp.logger.info(f"Processing: {data}") |
| 47 | + return f"Processed: {data}" |
| 48 | + |
| 49 | +# Run the server |
| 50 | +if __name__ == "__main__": |
| 51 | + hatch_mcp.server.run() |
| 52 | +``` |
| 53 | + |
| 54 | +### Existing FastMCP Server |
| 55 | + |
| 56 | +Assuming you have an existing FastMCP server (`mcp_server.py`) |
| 57 | + |
| 58 | +```python |
| 59 | +from mcp.server.fastmcp import FastMCP |
| 60 | + |
| 61 | +existing_server = FastMCP("my_existing_server") |
| 62 | + |
| 63 | +@existing_server.tool() |
| 64 | +def existing_function(data: str) -> str: |
| 65 | + return f"Existing: {data}" |
| 66 | +``` |
| 67 | + |
| 68 | +You can wrap it with HatchMCP: |
| 69 | + |
| 70 | +```python |
| 71 | +from mcp.server.fastmcp import FastMCP |
| 72 | +from hatch_mcp_server import HatchMCP |
| 73 | + |
| 74 | +from mcp_server import existing_server |
| 75 | + |
| 76 | +# Wrap with HatchMCP for citation capabilities |
| 77 | +hatch_mcp = HatchMCP( |
| 78 | + name="my_existing_server", |
| 79 | + fast_mcp=existing_server, |
| 80 | + origin_citation="Original work citation", |
| 81 | + mcp_citation="MCP implementation citation" |
| 82 | +) |
| 83 | + |
| 84 | +# Run the server |
| 85 | +if __name__ == "__main__": |
| 86 | + hatch_mcp.server.run() |
| 87 | +``` |
| 88 | + |
| 89 | +The server automatically exposes citation information through: |
| 90 | + |
| 91 | +- `citation://origin/MyServer` - Original algorithm citation |
| 92 | +- `citation://mcp/MyServer` - MCP implementation citation |
| 93 | + |
| 94 | +## Documentation |
| 95 | + |
| 96 | +📚 **[Complete Documentation](docs/articles/index.md)** - Full documentation table of contents and navigation guide |
| 97 | + |
| 98 | +### Quick Start Guides |
| 99 | + |
| 100 | +- **[Getting Started](docs/articles/users/GettingStarted.md)** - Installation, setup, and first steps |
| 101 | +- **[API Reference](docs/articles/users/APIReference.md)** - Complete API documentation |
| 102 | +- **[Citation System](docs/articles/users/CitationSystem.md)** - Understanding scientific attribution features |
| 103 | +- **[Examples](docs/articles/users/Examples.md)** - Practical usage patterns and code samples |
| 104 | + |
| 105 | +### Developer Resources |
| 106 | + |
| 107 | +- **[Contributing Guide](docs/articles/devs/contribution_guidelines/Contributing.md)** - Complete development workflow and MCP-specific requirements |
| 108 | +- **[Architecture Overview](docs/articles/devs/architecture/Overview.md)** - Design principles and implementation details |
| 109 | + |
| 110 | +### I Want To |
| 111 | + |
| 112 | +- **🚀 Get started quickly** → [Installation & Quick Start](docs/articles/users/GettingStarted.md#installation) |
| 113 | +- **🔄 Wrap existing FastMCP servers** → [Basic Usage](docs/articles/users/GettingStarted.md#Wrapping-Existing-FastMCP-Servers) |
| 114 | +- **📖 Learn about citations** → [Citation System Guide](docs/articles/users/CitationSystem.md) |
| 115 | +- **🔍 Look up specific APIs** → [API Reference](docs/articles/users/APIReference.md) |
| 116 | +- **💡 See examples** → [Examples & Patterns](docs/articles/users/Examples.md) |
| 117 | +- **🛠️ Contribute code** → [Contributing Guide](docs/articles/devs/contribution_guidelines/Contributing.md) |
| 118 | +- **🏗️ Understand design** → [Architecture Overview](docs/articles/devs/architecture/Overview.md) |
| 119 | +- **📋 Browse all docs** → [Documentation Table of Contents](docs/articles/index.md) |
| 120 | + |
| 121 | +## Why Use HatchMCP? |
| 122 | + |
| 123 | +### Scientific Transparency |
| 124 | + |
| 125 | +```python |
| 126 | +# Citation information is automatically available to MCP clients |
| 127 | +# citation://origin/ServerName -> "Smith, J. 'Algorithm X', Nature, 2024" |
| 128 | +# citation://mcp/ServerName -> "Your Name, 'MCP Implementation', 2024" |
| 129 | +``` |
| 130 | + |
| 131 | +### Zero Configuration |
| 132 | + |
| 133 | +```python |
| 134 | +# Just wrap your server - citation resources are registered automatically |
| 135 | +hatch_mcp = HatchMCP("server_name", origin_citation="...", mcp_citation="...") |
| 136 | +# Use hatch_mcp.server exactly like FastMCP |
| 137 | +``` |
| 138 | + |
| 139 | +### FastMCP Compatibility |
| 140 | + |
| 141 | +```python |
| 142 | +# Wrap existing FastMCP servers without changes |
| 143 | +existing_server = FastMCP("my_server") |
| 144 | +wrapped = HatchMCP("my_server", fast_mcp=existing_server, ...) |
| 145 | +``` |
| 146 | + |
| 147 | +## Contributing |
| 148 | + |
| 149 | +We welcome contributions! Please see our comprehensive [Contributing Guide](docs/articles/devs/contribution_guidelines/Contributing.md) for detailed guidelines covering development workflow, MCP compatibility requirements, and coding standards. |
| 150 | + |
| 151 | +### Overview |
| 152 | + |
| 153 | +1. **Fork and clone** the repository |
| 154 | +2. **Install dependencies**: `pip install -e .` and `npm install` |
| 155 | +3. **Create a feature branch**: `git checkout -b feat/your-feature` |
| 156 | +4. **Make changes** and add tests |
| 157 | +5. **Use conventional commits**: `npm run commit` for guided commits |
| 158 | +6. **Create a pull request** |
| 159 | + |
| 160 | +For complete details on commit formats, testing requirements, and MCP-specific development guidelines, see the [Contributing Guide](docs/articles/devs/contribution_guidelines/Contributing.md). |
| 161 | + |
| 162 | +## Requirements |
| 163 | + |
| 164 | +- **Python**: 3.12+ |
| 165 | +- **Dependencies**: `mcp>=1.6.0` |
| 166 | +- **Compatibility**: FastMCP servers and MCP clients |
| 167 | + |
| 168 | +## License |
| 169 | + |
| 170 | +AGPL v3: see [LICENSE](./LICENSE) |
| 171 | + |
| 172 | +--- |
| 173 | + |
| 174 | +**Part of the [Cracking Shells Ecosystem](https://github.com/CrackingShells)**: [Hatch!](https://github.com/CrackingShells/Hatch) - A package management system for scientific MCP servers. |
0 commit comments