⚡ OCO AI Signals FastMCP Gateway
🧪 Live Sandbox
Staging Cluster Online

FastMCP Integration Reference

Direct, high-conviction FDI & Corporate Expansion Intelligence for Autonomous AI Agents

🌐 Gateway Endpoints & Connectivity

The OCO FastMCP Gateway exposes our verified 1.77M+ signal Data Lake using the Model Context Protocol (MCP 2024-11-05) over Streamable HTTP and REST fallbacks.

Method Endpoint Path Protocol / Target Authentication
POST /mcp Streamable HTTP / SSE (JSON-RPC 2.0) Bearer JWT
GET /v1/signals/search OpenAPI REST Fallback Bearer JWT
POST /v1/auth/token Client Credentials Token Minting Client Secret Required
GET /health Liveness & PostgreSQL Status Probe Public

🔑 Authentication & Bearer JWT Token Lifecycle

The OCO FastMCP Gateway enforces tenant isolation, zero-leak credential isolation, and time-bounded permissions. All invocations across /mcp and /v1/signals/search require a cryptographically verified Authorization: Bearer <token> header.

🛡️ Zero-Leak Credential Policy: Each partner or client is provisioned with a dedicated client_id (client_slug) and a high-entropy client_secret out-of-band via encrypted channel. No shared secrets or static bearer tokens are ever exposed publicly. Tokens are scoped HMAC-SHA256 (HS256) JSON Web Tokens.

Option A: Dynamic Token Minting via Gateway API (Recommended)

Clients and autonomous agent runners can obtain or renew standard 30-day Bearer JWTs programmatically using standard Client Credentials authentication (granting full access across the 1.77M+ Data Lake):

# Dynamic Token Request (cURL)
curl -X POST "https://staging-mcp.ococonnect.com/v1/auth/token"   -H "X-Client-Secret: <YOUR_CLIENT_SECRET>"   -H "Content-Type: application/json"   -d '{
    "client_id": "<YOUR_CLIENT_ID>"
  }'

Response payload (JSON):

{
  "token_type": "Bearer",
  "access_token": "<GENERATED_JWT_TOKEN>",
  "expires_in": 2592000,
  "client_id": "<YOUR_CLIENT_ID>",
  "scope": "all"
}

Option B: Autonomous Local Minting (Backend Microservices)

If your architecture requires offline token minting or zero-network startup for agent pods, you can generate HMAC-SHA256 (HS256) signed JWTs locally using your assigned client_secret:

JWT Claims Specification

Claim Type Required Value Description
algHeaderHS256HMAC with SHA-256 algorithm
typHeaderJWTToken type identifier
subPayloadagent-<client_id>Agent or subagent subject identifier
client_slugPayload<YOUR_CLIENT_ID>Client ID / slug verified against MCP client registry
entitlementPayload (Optional)enterprise_trial | productionAccount authorization tier (auto-resolved from registry if omitted)
scopePayload (Optional)all (default)Optional dataset scope (defaults to global Data Lake access)
issPayloadhttps://staging-mcp.ococonnect.comGateway issuer validation URL
audPayloadhttps://<your-domain>.comTarget client audience identifier (e.g. https://loftos.com)
iatPayloadUnix TimestampIssuance timestamp (e.g. int(time.time()))
expPayloadUnix TimestampExpiration timestamp (e.g. iat + 2592000 for 30 days)

Python Local Minting Example

import os
import time
import jwt

CLIENT_ID = os.environ.get("OCO_CLIENT_ID", "<YOUR_CLIENT_ID>")
CLIENT_SECRET = os.environ["OCO_CLIENT_SECRET"]

now = int(time.time())
payload = {
    "iss": "https://staging-mcp.ococonnect.com",
    "aud": "https://loftos.com",
    "client_slug": CLIENT_ID,
    "iat": now,
    "exp": now + (30 * 86400)  # 30-day validity
}

jwt_token = jwt.encode(payload, CLIENT_SECRET, algorithm="HS256")
print(f"Authorization: Bearer {jwt_token}")

TypeScript / Node.js Local Minting Example

import * as jwt from "jsonwebtoken";

const clientId = process.env.OCO_CLIENT_ID || "<YOUR_CLIENT_ID>";
const clientSecret = process.env.OCO_CLIENT_SECRET!;

const now = Math.floor(Date.now() / 1000);
const payload = {
  iss: "https://staging-mcp.ococonnect.com",
  aud: "https://loftos.com",
  client_slug: clientId,
  iat: now,
  exp: now + (30 * 86400)
};

const token = jwt.sign(payload, clientSecret, { algorithm: "HS256" });
console.log(`Authorization: Bearer ${token}`);

🛠️ Canonical Tool: search_signals

Conforms to Anthropic CCAR-F Domain 2 standards with orthogonal parameters. Fully backward compatible: existing callers without stream receive all signals transparently. Zero matches return a clean 200 OK with total: 0 and signals: [] to prevent agent crashes.

query
string • default: ""
Natural language keywords, company names, or investment themes (e.g. data center, semiconductor, logistics hub).
target_market
string • optional
Geographic territory filter (e.g. Germany, Hesse, Frankfurt).
sector
string • optional
Industry taxonomy (e.g. IT & Software, Automotive, Renewable Energy).
stream
string • default: "all"
Taxonomy stream: "all" (default, backward-compatible), "attraction" (cross-border Greenfield/Brownfield FDI), or "aftercare" (reinvestment, retention, modernization).
risk_level
string • optional
Operational risk filter: "High", "Medium", "Low", or None (ideal for at-risk site early warnings).
lookback_days
integer • optional
Temporal lookback filter (e.g. 30, 90, 180 days).
min_confidence
float • default: 0.65
Confidence score floor between 0.0 and 1.0.
limit / offset
integers • default: 5 / 0 (max limit: 50)
Pagination parameters for iterating through large result sets.

🏢 Specialized Tool: search_aftercare_signals

Dedicated tool for Investment Promotion Agencies (IPAs) and Regional Economic Developers managing existing corporate employers. Pre-filters the Data Lake to Business Aftercare (plant expansions, CAPEX modernization, local R&D hubs, workforce retention, and disinvestment early warnings).

query
string • default: ""
Keywords, company name, or facility terms.
target_market
string • optional
Territory filter (country, state, city).
sector
string • optional
Industry sector filter.
risk_level
string • optional
Filter by operational risk: "High" (at-risk sites, downsizings), "Medium", "Low".
lookback_days
integer • optional
Days lookback (up to 365).
limit / offset
integers • default: 5 / 0
Keyset/offset pagination parameters.

🧪 Live Sandbox & Signal Explorer

Execute real-time queries directly against the 1.77M+ FDI Data Lake using your credentials, inspect JSON responses, and test latency before connecting autonomous agents.

Have a Client Secret?
Quick Presets:

🔬 Protocol Testing with Anthropic MCP Inspector

To inspect tools, test JSON-RPC schema compliance, and debug SSE transport visually in the browser using Anthropic's official open-source tool:

# Launch Anthropic MCP Inspector in your terminal
npx @modelcontextprotocol/inspector

In the Inspector UI, select transport Streamable HTTP / SSE, enter endpoint URL https://staging-mcp.ococonnect.com/mcp, and add the header Authorization: Bearer <YOUR_BEARER_TOKEN>.

💻 Integration Examples

A. Streamable HTTP / SSE Invocations (cURL Handshake)

Under the MCP 2024-11-05 Streamable HTTP specification, ad-hoc HTTP clients execute a lightweight 2-step handshake: Step 1 establishes a session (emitting the mcp-session-id header), and Step 2 executes tool calls bound to that session. (Note: standard MCP clients and SDKs manage this automatically).

# Step 1: Initialize MCP Session (inspect response headers for 'mcp-session-id')
curl -i -X POST https://staging-mcp.ococonnect.com/mcp   -H "Authorization: Bearer <YOUR_BEARER_TOKEN>"   -H "Accept: application/json, text/event-stream"   -H "Content-Type: application/json"   -d '{
    "jsonrpc": "2.0",
    "method": "initialize",
    "params": {
      "protocolVersion": "2024-11-05",
      "capabilities": {},
      "clientInfo": {"name": "curl-client", "version": "1.0.0"}
    },
    "id": 1
  }'

# Step 2: Invoke Canonical Tool (pass the received 'mcp-session-id' header)
curl -X POST https://staging-mcp.ococonnect.com/mcp   -H "Authorization: Bearer <YOUR_BEARER_TOKEN>"   -H "mcp-session-id: <SESSION_ID_FROM_STEP_1>"   -H "Accept: application/json, text/event-stream"   -H "Content-Type: application/json"   -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "search_signals",
      "arguments": {
        "query": "data center",
        "target_market": "Germany",
        "limit": 5,
        "offset": 0
      }
    },
    "id": 2
  }'

B. Claude Desktop Configuration (claude_desktop_config.json)

{
  "mcpServers": {
    "oco-ai-signals": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-streamable-http",
        "https://staging-mcp.ococonnect.com/mcp"
      ],
      "env": {
        "MCP_HEADERS": "{\"Authorization\": \"Bearer <YOUR_BEARER_TOKEN>\"}"
      }
    }
  }
}

C. REST API Fallback Query (Direct HTTP GET)

curl "https://staging-mcp.ococonnect.com/v1/signals/search?query=data+center&target_market=Germany&limit=2" \
  -H "Authorization: Bearer <YOUR_BEARER_TOKEN>"