Skip to main content

Getting Started with MCP Services

This guide shows you how to connect to Cred Protocol’s MCP services using different methods.

Method 1: HTTP Endpoints (Simplest)

The easiest way to use MCP services is through the HTTP endpoints. No setup required.

Base URL

https://api.credprotocol.com/mcp/sandbox

Quick Test

# Get a credit score
curl https://api.credprotocol.com/mcp/sandbox/score/vitalik.eth

# List available tools
curl https://api.credprotocol.com/mcp/sandbox/tools

Response

{
  "address": "0x...",
  "score": 870,
  "decile": 9,
  "range": "very_good",
  "model_version": "andromeda_1.0",
  "timestamp": "2024-01-15T10:30:00Z"
}

Method 2: Cursor IDE Integration

If you’re using Cursor, you can integrate Cred Protocol as an MCP server.

Step 1: Configure Cursor

Add to your .cursor/mcp.json file:
{
  "mcpServers": {
    "cred-protocol": {
      "command": "curl",
      "args": ["-s", "https://api.credprotocol.com/mcp/sandbox/tools"]
    }
  }
}
For full MCP protocol support (stdio), you’ll need to run the MCP server locally. See Local Development below.

Step 2: Use in Cursor

Once configured, you can ask Cursor’s AI:
“What’s the credit score for vitalik.eth?”
The AI will automatically call the MCP tool and respond with the result.

Method 3: Claude Desktop

For Claude Desktop, add to your MCP configuration:
{
  "mcpServers": {
    "cred-protocol": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-client", "https://api.credprotocol.com/mcp/sandbox"]
    }
  }
}

Method 4: Custom MCP Client

Build your own MCP client using the MCP SDK:

Python

import httpx

async def get_credit_score(address: str) -> dict:
    """Get credit score via MCP HTTP endpoint."""
    async with httpx.AsyncClient() as client:
        response = await client.get(
            f"https://api.credprotocol.com/mcp/sandbox/score/{address}"
        )
        return response.json()

# Usage
score = await get_credit_score("vitalik.eth")
print(f"Score: {score['score']} ({score['range']})")

JavaScript/TypeScript

async function getCreditScore(address: string): Promise<CreditScore> {
  const response = await fetch(
    `https://api.credprotocol.com/mcp/sandbox/score/${address}`
  );
  return response.json();
}

// Usage
const score = await getCreditScore("vitalik.eth");
console.log(`Score: ${score.score} (${score.range})`);

Local Development

For full MCP protocol support with stdio communication, run the server locally:

Prerequisites

Start the Server

# Start all services
docker compose up -d

# Test the MCP endpoints
curl http://localhost:8000/mcp/sandbox/score/vitalik.eth

Configure Cursor for Local Development

{
  "mcpServers": {
    "cred-protocol-local": {
      "command": "docker",
      "args": ["exec", "-i", "cred-webapp-backend-1", "python", "/app/mcp_server.py"]
    }
  }
}
The stdio MCP server requires the mcp Python SDK. Install with: pip install mcp>=1.0.0

Available Endpoints

EndpointMethodDescription
/mcp/sandbox/toolsGETList all available tools
/mcp/sandbox/score/{address}GETGet credit score
/mcp/sandbox/score/batchPOSTBatch score multiple addresses
/mcp/sandbox/summary/{address}GETGet financial summary
/mcp/sandbox/identity/{address}GETGet identity attestations
/mcp/sandbox/portfolio/{address}GETGet total portfolio value
/mcp/sandbox/portfolio/{address}/chain/{chain_id}GETGet chain-specific portfolio

Next Steps