This project implements a DCAP (Dynamic Capability Acquisition Protocol) MCP server that connects to the DCAP intelligence stream and provides real-time access to tool discovery data.
- DCAP Stream Connection: Connects to
ws://159.89.110.236:10191for real-time tool intelligence - FIFO Cache: Maintains up to 100 most recently discovered tools with deduplication
- MCP Tools: Exposes 7 tools for querying AND CALLING discovered tools
- Autonomous Tool Acquisition: Call ANY discovered tool at runtime without manual configuration
- x402 Payment Support: Automatic payment creation for paid tools using pipe402
- Multi-Transport Support: SSE, HTTP streaming for remote MCP servers
- Auto-Reconnect: Automatically reconnects if the DCAP stream connection drops
- Real-time Updates: Processes semantic_discover, perf_update, observed_sequence, and error_pattern messages
-
Clone this repository:
git clone https://github.com/boorich/dcap_disco.git cd dcap_disco -
Install dependencies:
pip install -r requirements.txt
-
Configure environment (optional, for x402 payments):
# Create .env file echo "X402_PRIVATE_KEY=0x..." > .env # Or export directly export X402_PRIVATE_KEY=0x...
-
Ensure pipe402 is installed (for x402 payment support):
which pipe402 # Should return path to pipe402 binary
python server.pyThe server will:
- Connect to the DCAP intelligence stream
- Start caching tool discoveries and performance data
- Expose MCP tools for querying the cached data
Add to your claude_desktop_config.json:
{
"mcpServers": {
"dcap-disco": {
"command": "python",
"args": ["/absolute/path/to/server.py"]
}
}
}Add to your MCP settings:
{
"mcpServers": {
"dcap-disco": {
"command": "python",
"args": ["/absolute/path/to/server.py"]
}
}
}Get all tools currently in the cache (up to 100 most recent).
Returns: List of tool discovery messages with capabilities, endpoints, and stats.
Search for tools by keyword in their capabilities.
Parameters:
query(string): Search keywords
Returns: Matching tools
Get detailed information about a specific tool.
Parameters:
tool_name(string): Name of the tool
Returns: Tool metadata with performance history
Get recent performance updates from all tools.
Parameters:
limit(number, optional): Max results (default: 20, max: 100)tool_name(string, optional): Filter by specific tool
Returns: Recent performance updates
Get observed tool execution sequences (chains).
Parameters:
limit(number, optional): Max sequences (default: 10)
Returns: Tool usage patterns
Get DCAP stream connection status.
Returns: Connection stats and cache size
Call a discovered tool at runtime - enables autonomous tool acquisition!
This is the killer feature: you can invoke ANY tool discovered via DCAP without manual configuration. The server:
- Looks up the tool in cache (from semantic_discover messages)
- Creates x402 payment if needed (using pipe402)
- Establishes MCP connection (SSE/HTTP)
- Calls the remote tool
- Returns result
Parameters:
tool_identifier(string): Format"tool_name@server_id"(e.g.,"validate_daml_business_logic@canton-mcp") or just"tool_name"arguments(object): Tool-specific arguments
Returns: Tool execution result
Example:
{
"tool_identifier": "validate_daml_business_logic@canton-mcp",
"arguments": {
"daml_code": "template MyContract with ..."
}
}Demo Flow:
1. Canton MCP broadcasts semantic_discover
→ DCAP Disco caches: validate_daml_business_logic@canton-mcp
2. Agent queries: list_discovered_tools
→ Sees: validate_daml_business_logic@canton-mcp
3. Agent calls: call_discovered_tool
→ DCAP Disco:
- Creates x402 payment (pipe402)
- Connects to Canton MCP (SSE)
- Calls validate_daml_business_logic
- Returns result
4. Agent gets result - no manual configuration needed!
X402_PRIVATE_KEY: Private key for creating x402 payments (hex string starting with0x)
For tools requiring bearer token auth, set:
<SERVER_ID>_TOKEN: Token for specific server (e.g.,ROBONET_MCP_TOKEN)
┌─────────────────────────────────────────────────────────────────┐
│ DCAP Disco MCP Server │
│ │
│ ┌──────────────┐ ┌─────────────┐ ┌───────────────┐ │
│ │ DCAP Stream │─────▶│ Cache │─────▶│ MCP Tools │ │
│ │ Client │ │ (Discover) │ │ (Query/List) │ │
│ └──────────────┘ └─────────────┘ └───────────────┘ │
│ │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ Tool Connection Manager (NEW!) │ │
│ │ │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────────────────┐ │ │
│ │ │ x402 │ │ MCP │ │ Dynamic Tool Call │ │ │
│ │ │ Payment │─▶│ Client │─▶│ (SSE/HTTP/stdio) │ │ │
│ │ │ (pipe402)│ │ (httpx) │ │ │ │ │
│ │ └──────────┘ └──────────┘ └──────────────────────┘ │ │
│ └──────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
│ ▲
│ discovers │ invokes
▼ │
┌──────────────────┐ ┌──────────────────┐
│ Canton MCP │ │ Canton MCP │
│ (broadcasts) │ │ (executes) │
└──────────────────┘ └──────────────────┘
Traditional MCP Setup:
// You must manually configure EVERY tool server:
{
"mcpServers": {
"canton-mcp": { "command": "...", "args": [...] },
"robonet-mcp": { "command": "...", "args": [...] },
"workbench-mcp": { "command": "...", "args": [...] }
// ... manually add 100 more ...
}
}With DCAP Disco:
// You configure ONLY the dcap-disco server:
{
"mcpServers": {
"dcap-disco": { "command": "python", "args": ["server.py"] }
}
}
// Now you can call ANY tool discovered on the network!
// No manual configuration. Just discovery + acquisition.This is "Google for AI agents" - autonomous capability acquisition at runtime.
Agent: "What DAML validation tools are available?"
DCAP Disco: "validate_daml_business_logic@canton-mcp"
Agent: "Call it with this code..."
DCAP Disco:
- Creates x402 payment automatically
- Connects to Canton MCP
- Calls tool
- Returns result
NO MANUAL CONFIGURATION!
Agent task: "Build a DAML contract AND test a trading strategy"
Agent:
1. Calls validate_daml_business_logic@canton-mcp
→ DCAP Disco connects to Canton MCP (first time)
2. Calls get_strategy_code@robonet-mcp
→ DCAP Disco connects to Robonet MCP (first time)
All automatic. All paid via x402. All discovered via DCAP.
Show VC:
- Stream of tools being discovered (semantic_discover)
- Agent querying available tools (list_discovered_tools)
- Agent calling tools dynamically (call_discovered_tool)
- x402 payments flowing
- Intelligence emerging from usage patterns
THIS IS THE FUTURE OF MCP.
MIT License
Pull requests welcome! For major changes, please open an issue first.
Questions? Reach out via [empeamtk@googlemail.com]
Ready to show VCs the future of autonomous agents? 🚀
This is what happens when you combine:
- DCAP (the open protocol for tool discovery)
- x402 (streaming micropayments for tool usage)
- MCP (the standard for agent-tool communication)
Result: Agents that can discover and use tools autonomously, with no manual configuration.