Skip to main content

Update MCP Rate Limit

Used to update MCP (Model Context Protocol) server rate limiting configuration. This allows you to control the rate at which requests are sent to the MCP server, preventing overload and ensuring compliance with the server's usage policies.

API Endpoint

PropertyValue
Request MethodPOST
Request URLhttps://api.seliseblocks.com/tools/mcp-rate-limit/{tool_id}

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/tools/mcp-rate-limit/{tool_id}?project_key=YOUR_PROJECT_KEY' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"Enabled": true,
"RequestsPerMinute": 100,
"RequestsPerHour": 6000,
"BurstSize": 10
}'

Path Parameters

FieldTypeRequiredDescription
tool_idstringYesThe unique identifier of the MCP server tool.

Query Parameters

FieldTypeRequiredDescription
project_keystringNoThe project key for your project.

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
Content-Typeapplication/jsonYesData type, must be application/json.

Request Body

Request Body Schema

{
"Enabled": false,
"RequestsPerMinute": 100,
"RequestsPerHour": 6000,
"BurstSize": 10
}

Request Body Parameters

FieldTypeRequiredDescription
EnabledbooleanNoWhether rate limiting is enabled (default: false).
RequestsPerMinuteintegerNoMaximum number of requests allowed per minute (default: 100).
RequestsPerHourintegerNoMaximum number of requests allowed per hour (default: 6000).
BurstSizeintegerNoMaximum number of requests allowed in a burst (default: 10).
note

Rate Limiting Configuration

  • Enabled: When disabled, no rate limiting is applied to MCP server requests
  • RequestsPerMinute: Controls short-term request rate to prevent overwhelming the server
  • RequestsPerHour: Enforces longer-term usage limits aligned with server policies
  • BurstSize: Allows temporary spikes in traffic while maintaining overall rate limits
  • Rate limits are applied per MCP server tool, not globally across all tools
tip

Best practices for rate limiting:

  • Enable rate limiting to protect both your application and the MCP server
  • Set RequestsPerMinute based on the MCP server's documented limits
  • Configure BurstSize to handle legitimate traffic spikes without hitting limits
  • Monitor rate limit metrics to optimize settings
  • Use conservative limits initially and adjust based on actual usage patterns

The system will:

  • Apply rate limits immediately after configuration
  • Queue requests that exceed the rate limit
  • Return rate limit errors if queues become full
  • Track rate limit metrics for monitoring
  • Automatically reset counters at the appropriate intervals

Response

Success Response (200 OK)

Returns an object containing the update status.

{
"is_success": true,
"item_id": "mcp_server_123",
"detail": "MCP rate limit configuration updated successfully",
"error": {}
}

Response Fields

FieldTypeDescription
is_successbooleanIndicates whether the update was successful.
item_idstringThe identifier of the MCP server tool.
detailstringSuccess or failure message with additional context.
errorobjectError details if the operation failed (empty if successful).

Error Response (422 Unprocessable Entity)

Returns validation error details when the request body is invalid.

{
"detail": [
{
"loc": [
"body",
"RequestsPerMinute"
],
"msg": "ensure this value is greater than 0",
"type": "value_error.number.not_gt"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., body field).
msgstringHuman-readable error message.
typestringError type identifier.

Error Codes

Status CodeDescriptionResponse Type
200Successful ResponseSuccess
400Bad Request - Invalid rate limit configurationBad Request
404Not Found - MCP server tool does not existNot Found
422Validation Error - Invalid request parametersUnprocessable Entity