Overview
The MCP Server with LangGraph exposes RESTful API endpoints for identity management, authentication, and user provisioning. All endpoints require authentication and follow RESTful conventions.Service Principals
Machine-to-machine authentication for automated workflows
API Keys
Long-lived authentication for CLI tools and legacy integrations
SCIM 2.0
Automated user provisioning from identity providers
Service Principals API
Service principals enable machine-to-machine authentication for batch jobs, streaming tasks, and background processes.Base Path
Authentication
All endpoints require Bearer token authentication:Create Service Principal
Creates a new service principal for machine-to-machine authentication.- Request
- Response
- Example
Endpoint: Body:Parameters:
POST /api/v1/service-principalsHeaders:name(required): Human-readable name for the service principaldescription(optional): Description of purposeauthentication_mode(required):client_credentialsorservice_accountassociated_user_id(optional): User ID to inherit permissions frominherit_permissions(optional): Enable permission inheritance (default: false)refresh_token_lifespan(optional): Refresh token lifetime in seconds (default: 2592000 = 30 days)
List Service Principals
Retrieves all service principals for the authenticated user.- Request
- Response
- Example
Endpoint: Query Parameters:
GET /api/v1/service-principalsHeaders:page(optional): Page number (default: 1)page_size(optional): Items per page (default: 20, max: 100)authentication_mode(optional): Filter by mode (client_credentialsorservice_account)
Get Service Principal
Retrieves details of a specific service principal.- Request
- Response
- Example
Endpoint: Path Parameters:
GET /api/v1/service-principals/{service_id}Headers:service_id: Service principal ID
Delete Service Principal
Deletes a service principal and revokes all its credentials.- Request
- Response
- Example
Endpoint: Path Parameters:
DELETE /api/v1/service-principals/{service_id}Headers:service_id: Service principal ID to delete
Rotate Secret
Rotates the client secret for a service principal.- Request
- Response
- Example
Endpoint: Body:Parameters:
POST /api/v1/service-principals/{service_id}/rotate-secretHeaders:grace_period_hours(optional): Hours to keep old secret valid (default: 24)
API Keys API
API keys provide simple, long-lived authentication for CLI tools, webhooks, and legacy integrations.Base Path
Authentication
All endpoints require Bearer token authentication:Create API Key
Creates a new API key for the authenticated user.- Request
- Response
- Example
Endpoint: Body:Parameters:
POST /api/v1/api-keysHeaders:name(required): Descriptive name for the API keyexpires_days(optional): Days until expiration (default: 365, max: 730)
List API Keys
Retrieves all API keys for the authenticated user.- Request
- Response
- Example
Endpoint: Query Parameters:
GET /api/v1/api-keysHeaders:include_expired(optional): Include expired keys (default: false)
Revoke API Key
Revokes an API key, making it invalid immediately.- Request
- Response
- Example
Endpoint: Path Parameters:
DELETE /api/v1/api-keys/{key_id}Headers:key_id: API key ID to revoke
Using API Keys
API keys are used in theapikey header:
- Prefix:
mcpkey_ - Environment:
live_(production) ortest_(development) - Token: 48-character random string (base62)
SCIM 2.0 API
SCIM (System for Cross-domain Identity Management) enables automated user provisioning from identity providers.Base Path
Authentication
SCIM endpoints support two authentication methods: Option 1: Bearer Token (Recommended)Supported Schemas
urn:ietf:params:scim:schemas:core:2.0:Userurn:ietf:params:scim:schemas:core:2.0:Groupurn:ietf:params:scim:api:messages:2.0:ListResponseurn:ietf:params:scim:api:messages:2.0:PatchOp
User Endpoints
Create User
Create User
Endpoint: Response:
POST /scim/v2/UsersRequest:201 CreatedGet User
Get User
Endpoint:
GET /scim/v2/Users/{id}Response: 200 OKUpdate User (PUT)
Update User (PUT)
Endpoint: Response:
PUT /scim/v2/Users/{id}Request:200 OK (updated user object)Update User (PATCH)
Update User (PATCH)
Endpoint: Supported Operations:
PATCH /scim/v2/Users/{id}Request:add: Add attribute valuereplace: Replace attribute valueremove: Remove attribute
200 OK (updated user object)Deactivate User
Deactivate User
Endpoint:
DELETE /scim/v2/Users/{id}Response: 204 No ContentThis sets
active: false on the user but doesn’t delete the account. The user can be reactivated via PATCH.Search Users
Search Users
Endpoint: Response: Supported Filter Operators:
GET /scim/v2/Users?filter={filter}Query Parameters:filter: SCIM filter expressionstartIndex: Pagination start (default: 1)count: Results per page (default: 20)
200 OKeq: Equalne: Not equalco: Containssw: Starts withew: Ends withpr: Present (attribute exists)
Group Endpoints
Create Group
Create Group
Endpoint: Response:
POST /scim/v2/GroupsRequest:201 CreatedGet Group
Get Group
Endpoint:
GET /scim/v2/Groups/{id}Response: 200 OKUpdate Group Membership
Update Group Membership
Endpoint: Response:
PATCH /scim/v2/Groups/{id}Request:200 OKBulk Operations
Endpoint:POST /scim/v2/Bulk
Create, update, or delete multiple resources in a single request.
200 OK
Error Responses
All SCIM endpoints return errors in SCIM format:invalidValue: Invalid attribute valuetooMany: Too many resultsuniqueness: Uniqueness constraint violatedmutability: Immutable attribute modification attemptedinvalidSyntax: Invalid filter syntaxinvalidFilter: Invalid filterinvalidPath: Invalid path expression
Rate Limiting
All API endpoints are rate-limited to prevent abuse:| Endpoint Category | Rate Limit | Window |
|---|---|---|
| Service Principals | 10 requests/minute | Per user |
| API Keys | 20 requests/minute | Per user |
| SCIM User Operations | 100 requests/minute | Per client |
| SCIM Bulk Operations | 10 requests/minute | Per client |
Error Handling
Common HTTP Status Codes
| Status | Meaning | When Used |
|---|---|---|
200 OK | Success | GET, PUT, PATCH requests |
201 Created | Resource created | POST requests |
204 No Content | Success, no body | DELETE requests |
400 Bad Request | Invalid request | Validation errors |
401 Unauthorized | Auth required/invalid | Missing or invalid token |
403 Forbidden | Insufficient permissions | Authorization failure |
404 Not Found | Resource not found | Invalid ID |
409 Conflict | Resource conflict | Duplicate username, key limit exceeded |
429 Too Many Requests | Rate limited | Exceeded rate limit |
500 Internal Server Error | Server error | Unexpected errors |
Error Response Format
Best Practices
Secure Credentials
- Store API keys and client secrets in secrets managers
- Never commit credentials to version control
- Rotate credentials regularly (90 days recommended)
- Use different credentials per environment
Error Handling
- Implement exponential backoff for retries
- Handle rate limiting gracefully
- Log request IDs for debugging
- Validate responses before processing
Performance
- Cache JWT tokens until expiration
- Use bulk SCIM operations for multiple users
- Implement request pooling/batching
- Monitor rate limit headers
Security
- Use HTTPS for all API calls
- Validate SSL certificates in production
- Implement request signing for SCIM (optional)
- Monitor for unusual API usage patterns