iowarp-mcp-integration

Bridge between AI and High-Performance Computing - MCP integration for IoWarp runtime

GitHub Stars

0

User Rating

Not Rated

Forks

0

Issues

0

Views

1

Favorites

0

README
IoWarp MCP Integration

Bridge between AI and High-Performance Computing

This repository contains the Model Context Protocol (MCP) integration for the IoWarp runtime, enabling Large Language Models (LLMs) to access high-performance C++ computational capabilities through standardized protocols.

Overview

The MCP integration introduces MChiPs (MCP-compatible ChiMods) - a new category of IoWarp modules that expose their capabilities to LLMs while maintaining the high-performance characteristics of the IoWarp runtime.

Key Features
  • 🚀 High Performance: Microsecond-level execution times with C++ optimization
  • 🔗 LLM Compatible: Standard MCP protocol support for AI integration
  • ⚡ Parallel Execution: Leverages IoWarp's lane-based concurrency
  • 🧮 Scientific Computing: BLAS/LAPACK integration for mathematical operations
  • 📈 Scalable: Distributed execution across multiple nodes
  • 🛡️ Type Safe: JSON schema validation and strong typing
Architecture
LLM Client (Claude, etc.)
    ↓ (MCP Protocol via stdio/SSE)
MCP Server ChiMod
    ↓ (IoWarp Tasks)
IoWarp Runtime
    ↓ (Task Distribution)
MChiP Modules (math, data, hpc, etc.)
    ↓ (High-performance C++ execution)
Results back to LLM
Components
1. MCP Server ChiMod (mcp_server/)

The core MCP protocol handler that:

  • Implements JSON-RPC MCP protocol
  • Discovers tools from MChiP modules
  • Routes requests to appropriate modules
  • Handles transport layers (stdio, SSE, WebSocket)
2. MChiP Interface (mcp_server/include/mcp_server/mchip_interface.h)

Standard interface for creating MCP-compatible ChiMods:

  • McpToolProvider interface
  • Tool, resource, and prompt definitions
  • JSON schema validation utilities
3. Example MChiP: Math Operations (mcp_math/)

Demonstrates MChiP development with mathematical operations:

  • Tools: Matrix multiplication, statistics, arithmetic
  • Resources: Mathematical constants (π, e)
  • Performance: BLAS/LAPACK integration, SIMD optimization
  • Scalability: Lane-based routing for different operation types
Quick Start
Prerequisites
  • IoWarp runtime environment
  • CMake 3.25+
  • C++17 compiler
  • nlohmann/json library
  • Optional: BLAS/LAPACK for math operations
Building
# Configure build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release

# Build MCP integration
make mcp_server mcp_math -j$(nproc)

# Install modules
make install
Running MCP Server
# Start MCP server with math capabilities
./chimaera_runtime --mcp-stdio --modules mcp_server,mcp_math
LLM Integration

Claude Desktop configuration:

{
  "mcpServers": {
    "iowarp-math": {
      "command": "/path/to/chimaera_runtime",
      "args": ["--mcp-stdio", "--modules", "mcp_server,mcp_math"]
    }
  }
}
Usage Examples
Mathematical Operations
// Matrix multiplication via MCP
{
  "method": "tools/call",
  "params": {
    "name": "matrix_multiply",
    "arguments": {
      "matrix_a": [1, 2, 3, 4],
      "matrix_b": [5, 6, 7, 8], 
      "rows_a": 2,
      "cols_a": 2,
      "rows_b": 2,
      "cols_b": 2
    }
  }
}
Statistical Analysis
// Comprehensive statistics
{
  "method": "tools/call", 
  "params": {
    "name": "statistics",
    "arguments": {
      "data": [1, 2, 3, 4, 5, 100, 200, 300]
    }
  }
}
Resource Access
// Access mathematical constants
{
  "method": "resources/read",
  "params": {
    "uri": "math://constants/pi"
  }
}
Performance Characteristics
Operation Latency Throughput Optimization
Basic arithmetic < 10μs 1M+ ops/sec SIMD
Matrix multiply < 1ms Depends on size BLAS
Statistics < 100μs 100K+ datasets/sec Vectorized
Tool discovery < 50μs Real-time Cached
Development
Creating a New MChiP
  1. Copy template structure
  2. Implement McpToolProvider interface
  3. Define tools with JSON schemas
  4. Add to CMake configuration
  5. Write tests

See docs/ChiMods-6-MChiP-Development.md for detailed guide.

Example MChiP Structure
class MyMChiP : public Module, public McpToolProvider {
public:
  // Standard ChiMod interface
  void Create(CreateTask *task, RunContext &rctx) override;
  Lane *MapTaskToLane(const Task *task) override;
  void Run(u32 method, Task *task, RunContext &rctx) override;

  // MCP interface
  std::vector<McpTool> GetMcpTools() override;
  McpToolResult ExecuteMcpTool(const std::string &name, const json &params) override;
  std::string GetMcpModuleName() const override;
};
Documentation
Use Cases
Scientific Computing + AI
  • Computational Biology: DNA analysis, protein folding
  • Physics Simulations: Particle systems, fluid dynamics
  • Engineering: CAD analysis, structural optimization
Data Science + AI
  • Large Dataset Processing: Statistical analysis at scale
  • Machine Learning: High-performance linear algebra
  • Signal Processing: FFT, filtering, time-series analysis
System Integration
  • HPC Clusters: AI-driven job scheduling and optimization
  • Real-time Systems: AI control with microsecond response times
  • Edge Computing: AI with minimal latency requirements
Contributing
  1. Fork the repository
  2. Create feature branch
  3. Implement MChiP following development guide
  4. Add comprehensive tests
  5. Submit pull request
License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments
  • IoWarp Runtime Team for the foundational architecture
  • Model Context Protocol specification for standardization
  • Scientific computing community for performance requirements

Bridging AI and HPC - Making high-performance computing accessible to artificial intelligence.

Author Information
Jaime Cernuda

PhD student at the Scalable Computing Software Lab @ IIT

IITChicago

3

Followers

38

Repositories

0

Gists

1

Total Contributions

Top Contributors

Threads