MCP Server
The Model Context Protocol (MCP) server allows AI tools and LLMs to interact withRepo Cat programmatically.
Introduction
The Model Context Protocol (MCP) is an open standard that enables AI assistants to interact with external systems.Repo Cat provides an MCP server that exposes tools, resources, and prompts for repository analysis.
With the MCP server, AI tools like Claude, GPT, and others can trigger scans, retrieve results, manage settings, and more — all through a standardized protocol.
Server Name: repo-cat-mcp Version: 1.0.0 Transport: Streamable HTTP (Stateless)
Authentication
The MCP server uses the same API key authentication as the REST API. You must include a valid API key with each request.
Authentication Methods
- Header:
Authorization: Bearer <api-key> - Query Parameter:
?apiKey=<api-key>
Stateless Mode
The MCP server operates in stateless mode. Each request creates a new transport instance with no session persistence. The user context (userId) is extracted from the API key and passed to tools via the request context.
Endpoint
The MCP server is available at the following endpoint:
http://repo-cat.futoro.co.uk/mcp
Transport Details
| Property | Value |
|---|---|
| Transport | Streamable HTTP |
| Session | Stateless (no session persistence) |
| Method | POST (Streamable HTTP) |
| Content-Type | application/json |
Tools
The MCP server exposes 9 tools for interacting with Repo Cat. All tools require authentication.
trigger_scan
Trigger a new repository scan (async)
| Parameter | Type | Description |
|---|---|---|
| repo | string | GitHub repository in format "owner/repo" |
| level | string | "basic", "standard", or "deep" |
| reference | string | Branch or tag to scan (optional) |
get_scan
Get scan details by ID
| Parameter | Type | Description |
|---|---|---|
| scanId | number | The ID of the scan to retrieve |
list_scans
List user's scans with filtering
| Parameter | Type | Description |
|---|---|---|
| page | number | Page number for pagination |
| status | string | Filter by status (optional) |
| level | string | Filter by scan level (optional) |
cancel_scan
Cancel an in-progress scan
| Parameter | Type | Description |
|---|---|---|
| scanId | number | The ID of the scan to cancel |
delete_scan
Delete a scan by ID
| Parameter | Type | Description |
|---|---|---|
| scanId | number | The ID of the scan to delete |
get_scan_pdf
Generate and retrieve PDF report (returns base64-encoded PDF)
| Parameter | Type | Description |
|---|---|---|
| scanId | number | The ID of the scan for PDF generation |
get_user_info
Get current user details and subscription
No parameters required
get_settings
Retrieve user settings
No parameters required
update_settings
Update user settings
| Parameter | Type | Description |
|---|---|---|
| email_notifications_enabled | boolean | Enable email notifications (optional) |
| email_on_scan_started | boolean | Receive email when scan starts (optional) |
| email_on_scan_completed | boolean | Receive email when scan completes (optional) |
| email_on_scan_failed | boolean | Receive email when scan fails (optional) |
| email_on_scan_cancelled | boolean | Receive email when scan is cancelled (optional) |
| webhook_enabled | boolean | Enable webhook notifications (optional) |
| webhook_url | string | Webhook URL for notifications (optional) |
| webhook_on_scan_started | boolean | Trigger webhook when scan starts (optional) |
| webhook_on_scan_completed | boolean | Trigger webhook when scan completes (optional) |
| webhook_on_scan_failed | boolean | Trigger webhook when scan fails (optional) |
| webhook_on_scan_cancelled | boolean | Trigger webhook when scan is cancelled (optional) |
Resources
Resources provide access to data entities. The MCP server exposes one resource for accessing scan results.
| URI | Description |
|---|---|
| scan://{scanId} | Full scan result with metadata, heuristics, and analysis |
Example: Accessing a Scan Resource
// Access scan resource via MCP
const result = await client.readResource({
uri: 'scan://123',
});
console.log(result.contents[0].text);Prompts
Prompts are guided templates that help AI tools perform complex tasks. The MCP server provides a prompt for analyzing repositories.
analyze-repo
Guided prompt template that helps AI tools analyze a GitHub repository by triggering a scan and polling for results.
When an AI tool uses this prompt, it guides the assistant through:
- Calling the
trigger_scantool to start a scan - Polling the
get_scantool to check progress - Providing a comprehensive summary once complete
Example Usage
Connect to the MCP server using the official MCP SDK.
JavaScript: Connecting with MCP SDK
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
const transport = new StreamableHTTPClientTransport(
new URL('http://repo-cat.futoro.co.uk/mcp')
);
const client = new Client(
{ name: 'example-client', version: '1.0.0' },
{ capabilities: {} }
);
await client.connect(transport);
// Call a tool
const result = await client.callTool({
name: 'trigger_scan',
arguments: {
repo: 'facebook/react',
level: 'standard',
},
});
console.log(result);cURL: Calling a Tool Directly
You can also call MCP tools directly using cURL with JSON-RPC:
curl -X POST "http://repo-cat.futoro.co.uk/mcp" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-api-key-here" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "trigger_scan",
"arguments": {
"repo": "facebook/react",
"level": "standard"
}
}
}'Use Case: AI Repository Analysis
An AI tool can use the analyze-repo prompt to analyze a repository:
- AI loads the
analyze-repoprompt - Prompt guides AI to call
trigger_scanwith repo details - AI polls
get_scanto check scan status - Once complete, AI reads the
scan://{scanId}resource - AI provides a comprehensive analysis to the user