Skip to main content

API Endpoint

The MCP Hub endpoint is:
https://nexus.civic.com/hub/mcp

Authentication

The MCP Hub supports multiple authentication methods:

Bearer Token (Civic Auth)

For user-facing applications using Civic Auth OAuth2 flow:
headers: {
  'Authorization': `Bearer ${accessToken}`
}

API Key

For server-to-server communication:
headers: {
  'Authorization': `Bearer ${process.env.MCP_API_KEY}`
}
Contact us to obtain an API key.

Integration Methods

1. Claude Desktop Integration

Connect Claude Desktop to Civic MCP Hub using the Hub Bridge.

Installation (MacOS)

  • npm
  • homebrew
  npx @civic/hub-bridge install claude-desktop

Manual Configuration (PC, Linux etc)

Add the following to your Claude Desktop configuration:
  • macOS
  • Windows
  • Linux
open "~/Library/Application Support/Claude/claude_desktop_config.json"
Add this configuration:
{
  "mcpServers": {
    "civic": {
      "command": "npx",
      "args": ["@civic/hub-bridge"]
    }
  }
}

2. Vercel AI SDK Integration

Use the MCP Hub with Vercel AI SDK for building AI applications.
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { getTokens } from "@civic/auth/nextjs";

const createMCPClient = async () => {
  // Get access token
  const { accessToken } = await getTokens();
  
  if (!accessToken) {
    throw new Error('No access token available. User needs to authenticate.');
  }

  // Create transport with authentication
  const transport = new StreamableHTTPClientTransport(
    'https://nexus.civic.com/hub/mcp',
    {
      requestInit: {
        headers: {
          Authorization: `Bearer ${accessToken}`,
          'Content-Type': 'application/json'
        }
      }
    }
  );

  // Initialize MCP client
  const client = new Client({
    name: 'my-app',
    version: '1.0.0'
  }, {
    capabilities: {}
  });

  await client.connect(transport);
  return client;
};
For complete Vercel AI SDK integration examples, see our detailed Vercel AI SDK guide.

3. n8n Workflow Integration

Build AI-powered workflows with n8n and Civic Labs.

Prerequisites

  1. Import the example workflow into your n8n instance
  2. Configure your AWS Bedrock credentials in n8n (or use another AI model)
  3. Contact us to obtain an API key for the MCP Hub

Setup

Add your MCP Hub API key as a Header Auth credential in n8n:
{
  "name": "Authorization",
  "value": "Bearer YOUR_API_KEY"
}
The workflow demonstrates:
  • Calling MCP Hub API endpoints
  • Integrating with AI models
  • Building conversational agents with MCP tools
  • Error handling and retries

4. Direct API Integration

For custom integrations, use the MCP Hub API directly:
// List available MCP servers
const response = await fetch('https://nexus.civic.com/hub/mcp', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'tools/list',
    params: {},
    id: 1,
  }),
});

const result = await response.json();
console.log('Available tools:', result.result.tools);

Additional Resources

Contact us for detailed API documentation and support.