使用说明
CarbonArc MCP Client Examples
Minimal, self-contained MCP client examples showing how to connect to the CarbonArc MCP server from every popular language using the official Model Context Protocol SDKs.
Each example follows the same pattern:
- Connect to
https://mcp.carbonarc.ai/over Streamable HTTP - Authenticate via OAuth 2.0 (browser opens automatically where supported)
- Discover available tools
- Call
search_entitieswith"Walmart"as a quick smoke test
Client Examples at a Glance
| Language | Directory | SDK | Transport |
|---|---|---|---|
| Python | python/ |
fastmcp |
Streamable HTTP |
| TypeScript / Node.js | typescript/ |
@modelcontextprotocol/sdk |
StreamableHTTPClientTransport |
| Go | go/ |
modelcontextprotocol/go-sdk |
StreamableClientTransport |
Python
cd python
uv run python mcp_example.py
TypeScript / Node.js
Uses the official MCP TypeScript SDK
(@modelcontextprotocol/sdk). Includes a full OAuth 2.0 authorization-code
flow with a local callback server.
cd typescript
npm install
npx tsx mcp-example.ts
Go
Uses the official MCP Go SDK
(v1.5.0+). Requires Go 1.25+.
cd go
go mod tidy
go run -tags mcp_go_client_oauth .
Authentication
The CarbonArc MCP server requires OAuth 2.0 authentication. Most examples handle this by:
- Discovering the authorization endpoint via the server's
/.well-known/oauth-protected-resourcemetadata. - Registering a client dynamically (RFC 7591) if needed.
- Opening a browser for the user to log in.
- Receiving the auth code on a local callback server.
- Exchanging the code for an access token.
All three client examples implement the full browser-based OAuth flow.
Security
These examples are minimal quickstarts designed to demonstrate MCP connectivity. They store OAuth tokens in memory for the duration of the script and do not include:
- Token encryption at rest
- Audit logging
- Rate limiting
- Secret scanning or rotation
For production-grade security patterns — including AES-256-GCM token encryption, SOC 2 controls mapping, and reference implementations for AWS Secrets Manager, GCP Secret Manager, Azure Key Vault, and HashiCorp Vault — see the Carbon Arc Partnership Examples repository, specifically embedded-ca-user/SECURITY.md.