custom-mcp-server
Allows sending notifications and updating task status with Slack messages, including posting to channels and threads.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@custom-mcp-server Update annotation task task-123 to completed and notify Slack."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
custom-mcp-server
A production Model Context Protocol server for a data-annotation workflow. It exposes six tools over the MCP stdio transport, backed by AWS S3 + DynamoDB and Slack, with JWT auth, per-tool rate limiting, and exponential-backoff retries.
Prerequisites
Node.js 20 LTS
npm
AWS account (S3 bucket + DynamoDB table) and a Slack bot token for runtime use (not required to run the test suite — all external calls are mocked)
Related MCP server: Slack MCP Server
Install
npm installEnvironment setup
Copy .env.example to .env and fill in the values. Keys:
Key | Required by | Notes |
| all AWS tools | e.g. |
| all AWS tools | secret — keep out of source control |
| all AWS tools | secret |
|
| default bucket |
|
| table with partition key |
|
| secret, |
|
| e.g. |
| auth (every call) | expected |
| auth (every call) | expected |
| auth (RS256) | JWKS endpoint for signature verification |
| auth (HS256, dev only) | optional; ≥ 32 chars; refused when |
| auth | set to |
| rate limiter | default |
| retry | default |
| retry | default |
| logger |
|
Build / test / run
npm run build # compile TypeScript to dist/
npm run typecheck # tsc --noEmit
npm test # Jest (ESM) — all external calls mocked
npm start # node dist/server.js (stdio transport)Tools
Tool | Input (required**) | Required scope | Behavior |
|
|
| Upload base64 content to S3 under the caller's prefix; returns |
|
|
| Download object from the caller's prefix; returns |
|
|
| Read a record the caller owns; returns the item (without |
|
|
| Put a record stamped with the caller as |
|
|
| Post to Slack (text sanitized); returns |
|
|
| Read/update a task the caller owns, optionally notify Slack |
Auth model
Every tool call is authenticated and authorized:
Authentication. The caller supplies a JWT via
_meta.authorization(optionallyBearer-prefixed). The expected algorithm is pinned from server configuration — not the token header — to block algorithm-confusion attacks: RS256 (verified againstJWKS_URI) by default, or HS256 only when aJWT_SECRET(≥ 32 chars) is set andNODE_ENVis notproduction. The server checksiss/aud/expiry (with a small clock skew) and derives anAuthContext(subject,scopes). Invalid tokens →AUTH_INVALID.Scope authorization. Each tool declares
requiredScopes. A token missing a required scope is rejected withFORBIDDENbefore the handler runs.Object-level authorization (ownership). DynamoDB records carry an
ownerattribute and S3 keys are confined to a per-subject prefix (<subject>/…). Callers can only read/update their own records and objects; foreign records are reported as not-found to avoid ID enumeration. This prevents IDOR.Error handling. Callers receive only a stable error
codeplus arequestId; full error detail is logged server-side (stderr) and never leaked to the client.
JWKS keys are fetched through a cached, rate-limited client to avoid a network round-trip (and IdP DoS) on every verification. S3 up/downloads are capped at 10 MiB to bound memory use.
Rate limiting & retries
Rate limit: 100 requests/min per principal+tool (configurable), in-memory per process, keyed by
subject:toolso one caller cannot starve others. Unknown tool names are rejected before consuming limiter budget. Exceeding it yieldsRATE_LIMITED.Retry: transient failures (
retryable: true) are retried up to 3 times with exponential backoff (baseDelay * 2^(n-1)). Conflicts, validation, and auth errors are never retried.Idempotency note: retries wrap non-idempotent writes (
dynamo_write,slack_notify). Only transient errors are retried, but adding idempotency keys is recommended future work.
Cursor setup
.cursor/mcp.json registers the server with Cursor:
{
"mcpServers": {
"custom-mcp-server": {
"command": "node",
"args": ["dist/server.js"],
"env": { "AWS_REGION": "us-east-1", "...": "..." }
}
}
}Secrets (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, SLACK_BOT_TOKEN,
JWT_SECRET) are not placed in mcp.json; provide them via your shell
environment / .env. Run npm run build before launching so dist/server.js
exists.
Architecture
See PLAN.md for the full milestone plan, interface contracts, and
blocker analysis. Source layout:
src/
server.ts stdio transport + tool-call pipeline
config.ts env loading + validation (zod)
types.ts shared interface contracts
errors.ts AppError exception + guards
security.ts scopes, ownership, key-scoping & sanitization helpers
logger.ts stderr-only structured logger
auth/oauth.ts JWT validation (algorithm-pinned) + cached JWKS
middleware/ retry.ts, rate-limiter.ts
clients/ s3/dynamo/slack factories
tools/ one file per tool + index.tsAvailable Tools
6 toolsannotation_statusA
Read or update an annotation task's status, optionally notifying Slack.
Inputs: taskId (required), newStatus, notify.
dynamo_readA
Read a single record from DynamoDB by primary key 'id'.
Inputs: id (required), consistentRead.
dynamo_writeC
Write a record to DynamoDB keyed by 'id'.
Inputs: id (required), attributes (required), overwrite.
s3_downloadB
Download an object from S3 and return it base64-encoded.
Inputs: key (required), bucket.
s3_uploadB
Upload a base64-encoded object to S3.
Inputs: key (required), contentBase64 (required), contentType, bucket.
slack_notifyA
Post a message to a Slack channel.
Inputs: message (required), channel, threadTs.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: annotation_status for task status, dynamo_read/write for database, s3_download/upload for storage, slack_notify for messaging. No overlap.
Most tools follow verb_noun pattern (dynamo_read, dynamo_write, s3_download, s3_upload, slack_notify), but 'annotation_status' is an outlier as a noun phrase.
6 tools is well-scoped for a server covering annotation, database, storage, and Slack integration. It feels neither too few nor too many.
Each service has basic operations but lacks deletions, updates, and lists. For annotation only status is provided. This leaves notable gaps for typical workflows, but the server may be intentionally scoped.
Maintenance
Related MCP Connectors
Hosted MCP server to manage a restaurant menu from AI agents - 39 tools over the DuckHub API.
Hosted MCP server for MuntuAI outreach campaigns, leads, senders, domains, and analytics.
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
MCP server for Riveter's enrichment, scraping, and monitoring API
Related MCP Servers
- AlicenseAqualityDmaintenanceA production-grade MCP server that enables AI assistants like Claude to read Etsy shop data—listings, orders, inventory, and stats—through eight read-only tools, using OAuth and automatic pagination.8MIT
- AlicenseNot gradedqualityCmaintenanceA production-ready MCP server for the Slack API that enables searching, listing channels, reading history, inspecting users, fetching threads, and sending messages through controlled Slack tools.MIT
- AlicenseBqualityDmaintenanceUnified MCP server exposing 12 DevOps tools across GitHub, PostgreSQL, Slack, and Google Calendar for AI agents, with rate limiting, input validation, and per-service scoped tokens.30MIT
- FlicenseNot gradedqualityDmaintenanceA remote, OAuth2-authenticated MCP server that provides read-only S3 tools (list buckets, list objects, check public access, get bucket size) designed to run on ECS Fargate with Auth0 as the identity provider.1-