Integration Guide
Everything you need to connect IndiCarbon AI to your existing tools — REST API, MCP server, and AI agent workflows.
Overview
IndiCarbon AI exposes its full platform through a single API Gateway at http://localhost:8000 (or your cloud endpoint). All routes are prefixed with /api/v1/.
JWT login, RBAC roles, org management
/api/v1/auth/*GHG reporting, BRSR, emission factors
/api/v1/emissions/*Carbon credits, buy/sell orders, trades
/api/v1/orders/*Auditor & Strategist agents, document analysis
/api/v1/ai/*The full OpenAPI spec is available at http://localhost:8000/api/docs (Swagger UI) and /api/redoc (ReDoc).
Authentication
IndiCarbon uses JWT bearer tokens issued by Supabase Auth. Every protected endpoint requires an Authorization: Bearer <token> header.
1. Login and get token
curl -X POST http://localhost:8000/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "you@company.com", "password": "yourpassword"}'{
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "bearer",
"expires_in": 3600,
"user_id": "uuid-here",
"email": "you@company.com",
"roles": ["ORG_ADMIN"],
"is_internal": false
},
"message": "Login successful."
}2. Use the token
# Store the token TOKEN="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." # Use it in every subsequent request curl http://localhost:8000/api/v1/users/me \ -H "Authorization: Bearer $TOKEN"
Token lifecycle
- • Access tokens expire after 1 hour.
- • Use
POST /api/v1/auth/refreshwith the refresh token to get a new pair. - • Refresh tokens expire after 7 days.
- • The MCP server handles refresh automatically — no manual intervention needed.
RBAC Roles
Role-based access control governs what each user can do. Roles are assigned per-organisation.
| Role | Permissions |
|---|---|
| SUPER_ADMIN | Full platform access, sector benchmarks, internal tooling |
| ORG_ADMIN | Manage users, org settings, all compliance & marketplace ops |
| AUDITOR | Verify documents, review HITL flags, read all org data |
| ANALYST | Submit emission reports, upload documents, read marketplace |
| TRADER | Place and cancel marketplace orders, view credits |
| VIEWER | Read-only access to org data |
MCP Server
The IndiCarbon MCP (Model Context Protocol) server exposes every platform capability as AI-callable tools. Connect it to Claude, and the AI can perform end-to-end carbon accounting workflows through natural language.
Add to Claude Desktop / Cursor / Any MCP Client
The IndiCarbon MCP server is hosted — no local installation required. Add this to your MCP config (e.g. claude_desktop_config.json):
{
"mcpServers": {
"indicarbon": {
"url": "https://indicarbon.ajayv.online/mcp/",
"headers": {
"x-user-email": "your@email.com",
"x-user-password": "yourpassword"
}
}
}
}How authentication works
- • Your email and password are sent as headers on the initial MCP connection.
- • The server authenticates against IndiCarbon's auth service and issues a JWT session.
- • All subsequent tool calls in the session use the JWT — credentials are not resent.
- • Token refresh is handled automatically by the server.
Restart your AI client after saving. The 30 IndiCarbon tools will appear automatically.
Available MCP Tools
indicarbon_login · indicarbon_register · indicarbon_get_profile · indicarbon_list_users · indicarbon_list_roles · indicarbon_create_role · indicarbon_assign_role
indicarbon_create_organization · indicarbon_list_organizations · indicarbon_get_organization
indicarbon_register_document · indicarbon_list_documents · indicarbon_get_document · indicarbon_verify_document · indicarbon_get_document_signed_url
indicarbon_submit_emission_report · indicarbon_get_emission_summary · indicarbon_generate_brsr_report · indicarbon_list_emission_factors · indicarbon_calculate_scope_emissions · indicarbon_list_sector_benchmarks
indicarbon_list_carbon_credits · indicarbon_get_market_book · indicarbon_list_orders · indicarbon_place_order · indicarbon_cancel_order · indicarbon_retire_credits · indicarbon_list_trades
indicarbon_run_agent · indicarbon_analyse_document · indicarbon_chat_with_agent · indicarbon_get_chat_history · indicarbon_list_agent_registry · indicarbon_create_hitl_review · indicarbon_resolve_hitl_review
API Reference
/api/v1/emissionsSubmit Emission ReportSubmit a GHG emission data entry. System auto-calculates tCO₂e using India-specific emission factors.
{
"organization_id": "uuid",
"scope_type": "SCOPE_2",
"raw_quantity": 150000,
"activity_unit": "kWh",
"reporting_period_start": "2024-04-01",
"reporting_period_end": "2025-03-31",
"factor_key": "GRID_ELECTRICITY_IN"
}/api/v1/ordersPlace Carbon Credit OrderPlace a BUY or SELL order. Auto-matches against counterparties. Returns trade receipt if matched.
{
"organization_id": "uuid",
"order_type": "BUY",
"quantity": 500,
"price_per_unit": "1500.00",
"vintage_year": 2024,
"project_type": "solar"
}/api/v1/analyse-documentAnalyse Document with AIAI-powered extraction of emission data from sustainability reports, annual reports, and energy audits.
{
"organization_id": "uuid",
"document_id": "uuid"
}/api/v1/emissions/brsrGenerate BRSR ReportGenerate SEBI BRSR-compliant GHG disclosure for a reporting period.
?period_start=2024-04-01&period_end=2025-03-31&revenue_crore=4200
Full OpenAPI spec: http://localhost:8000/api/docs
Common Workflows
1. Annual Report → BRSR Compliance (via Claude + MCP)
- 1
indicarbon_login— Authenticate with org credentials - 2
indicarbon_list_organizations— Get your organisation UUID - 3
indicarbon_register_document— Register your uploaded annual report (file_path from Supabase Storage) - 4
indicarbon_analyse_document— AI extracts emission line items, calculates scope totals, saves to DB - 5
indicarbon_get_emission_summary— Review Scope 1 + 2 + 3 totals - 6
indicarbon_generate_brsr_report— Generate the SEBI BRSR disclosure
2. Carbon Credit Trading
- 1
indicarbon_get_market_book— View all open SELL orders — price, vintage, project type - 2
indicarbon_place_order (BUY)— Place a buy order; auto-matches if a SELL exists at your price - 3
indicarbon_list_orders— Confirm order status (OPEN → FILLED) - 4
indicarbon_list_carbon_credits— Verify credits transferred to your org - 5
indicarbon_retire_credits— Retire credits to offset your calculated emissions
SDKs & Tools
Full MCP server for AI agent integration. Works with Claude Desktop, Claude Code, and any MCP-compatible host.
D:\IndiCarbon\mcp-serverFull OpenAPI 3.1 spec. Use any HTTP client — curl, httpx, axios. Rate limit: 100 req/min per IP.
http://localhost:8000/api/docsAuditor and Strategist LangChain ReAct agents with Langfuse observability and HITL safety guardrails.
/api/v1/ai/runComing soon — subscribe to trade settled, document verified, and emission threshold breach events.
—Error Handling
All API responses follow the ApiResponse envelope:
// Success
{ "data": { ... }, "message": "Operation successful." }
// Error
{ "data": null, "error": "Detailed error message", "error_code": 422 }| Status | Meaning & Action |
|---|---|
| 401 | Token missing or expired → call /auth/refresh |
| 403 | Insufficient role → check your RBAC permissions |
| 404 | Resource not found → verify UUIDs |
| 422 | Validation error → check request body schema |
| 429 | Rate limited → back off for 60 seconds |
| 503 | Downstream service unavailable → retry with exponential backoff |