Skip to content

pabloleaf/targe-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@targe/mcp-server

MCP (Model Context Protocol) server for the Targe LLM Key Sharing Gateway.

Exposes 4 tools directly to Claude Desktop, Cursor, and any MCP-compatible client:

Tool Description
targe_proxy_pool Call an LLM (Anthropic, OpenAI, Google) through the Targe cost-sharing pool
targe_get_catalog List available providers, models, pricing, and pool availability
targe_get_balance Check your USDC balance on the Targe gateway
targe_register_key Share an API key with the pool to earn revenue

Requirements

  • Node.js ≥ 18
  • A Targe wallet (Ethereum private key)
  • USDC balance on Targe for targe_proxy_pool calls

Claude Desktop Setup

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "targe": {
      "command": "npx",
      "args": ["@targe/mcp-server", "--wallet-key", "0xYourPrivateKey"]
    }
  }
}

Or using an environment variable:

{
  "mcpServers": {
    "targe": {
      "command": "npx",
      "args": ["@targe/mcp-server"],
      "env": {
        "WALLET_KEY": "0xYourPrivateKey"
      }
    }
  }
}

Restart Claude Desktop after editing the config.

Usage

Once connected, Claude can use Targe tools directly:

"Check my Targe balance" → calls targe_get_balance

"What LLM models are available in the Targe pool?" → calls targe_get_catalog

"Use Targe to call claude-haiku-4-5-20251001 with this prompt: ..." → calls targe_proxy_pool

Manual Run

# With --wallet-key flag
npx @targe/mcp-server --wallet-key 0xYourPrivateKey

# With environment variable
WALLET_KEY=0xYourPrivateKey npx @targe/mcp-server

Tool Reference

targe_proxy_pool

Call an LLM through the Targe pool. Charges are deducted from your USDC balance at pool rates.

Input Type Required Description
provider "anthropic" | "openai" | "google" LLM provider
model string Model name (e.g. claude-haiku-4-5-20251001)
messages {role, content}[] Conversation messages
max_tokens number Max tokens (default: 1024)
system string System prompt (Anthropic only)
temperature number Sampling temperature (0.0–1.0)

targe_get_catalog

No inputs. Returns all available key pools with provider, models, blended rate, and pool size.

targe_get_balance

No inputs. Returns your current USDC balance and wallet address.

targe_register_key

Input Type Required Description
llmProvider "anthropic" | "openai" | "google" Provider for this key
baseUrl string Provider API base URL
apiKey string Key to share (encrypted at rest)
models string[] Model IDs this key can serve
tpm number Tokens per minute limit
rpm number Requests per minute limit
markupPercent number Markup % above cost (min 12%)
costBasis "subscription" | "payg" Affects suggested floor pricing

Top-Up Balance

To pay for LLM calls, deposit USDC to your Targe account:

  1. Ask Claude: "What's my Targe deposit address?" → calls targe_get_balance or the SDK's getDepositAddress()
  2. Send USDC (Base network) to the returned address
  3. Balance is credited after 3 confirmations

License

MIT

About

MCP server for Targe — use LLM key sharing and micropayments from Claude Desktop and Cursor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors