fairlead
fairlead
FDE take-home. Python 3.11, official mcp SDK.
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest1. MCP server (stdio)
The prompt asks for stdio, so this process talks JSON-RPC on stdin/stdout. Logs are stderr only.
python -m mcp_lab.task1.serverget_customer_record(customer_id)—CUST-plus five digitstrigger_refund(customer_id, amount, reason)— amount > 0, reason >= 10 chars
Pydantic rejects junk; that becomes JSON-RPC -32602. Sample ids: CUST-10428, CUST-22019.
2. MCP gateway
python -m mcp_lab.task2.downstream
python -m mcp_lab.task2.proxyAuthorization: Bearer admin or Bearer viewer. tools/list always goes downstream. tools/call on admin_* needs admin; otherwise -32001 and we don't forward.
3. Streaming PII filter
python -m mcp_lab.mocks.llm --mode leak --port 8092
python -m mcp_lab.task3.serverRewrites SSE deltas as they arrive ([REDACTED] for email / SSN / card). Doesn't wait for the full reply.
4. Rate limit + failover
python -m mcp_lab.task4.serverSQLite file data/gateway.sqlite, 50k tokens/min per API key. Primary 429 or 3s timeout → backup. Errors are {code, message, request_id} only.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yashaswip/fairlead'
If you have feedback or need assistance with the MCP directory API, please join our Discord server