Connecting Developer Tools via Model Context Protocol (MCP)
Understanding standard MCP tool servers, secure resource handlers, JSON-RPC communication, and how AI assistants interact safely with local databases and APIs.
Sonu Singh
Head of Developer Tooling
The Need for an Open Tool Standard
Before the Model Context Protocol (MCP) was introduced, integrating LLMs with external systems required writing proprietary connectors for every platform: one for ChatGPT plugins, another for Cursor, a third for Claude desktop, and custom wrappers for internal CLI tools.
MCP replaces this fragmented landscape with a universal, open standard over JSON-RPC. It allows AI clients to discover, query, and invoke tools, live resources, and prompt templates exposed by standard server processes running locally or over secure SSE streams.
MCP Architecture Under the Hood
An MCP deployment consists of three distinct participants: the Host application (such as Cursor or Claude Desktop), an MCP Client running inside the host, and one or more independent MCP Servers.
Communication occurs over standard input/output (stdio) for local tools, or Server-Sent Events (SSE) over HTTP for remote microservices. Every method invocation is typed via JSON Schema contracts.
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import {
CallToolRequestSchema,
ListToolsRequestSchema,
} from '@modelcontextprotocol/sdk/types.js';
import { z } from 'zod';
const server = new Server(
{ name: 'norai-postgres-inspector', version: '1.0.0' },
{ capabilities: { tools: {} } }
);
server.setRequestHandler(ListToolsRequestSchema, async () => ({
tools: [
{
name: 'query_read_only_schema',
description: 'Inspect database tables and column types safely',
inputSchema: {
type: 'object',
properties: {
tableName: { type: 'string', description: 'Table to inspect' },
},
required: ['tableName'],
},
},
],
}));Security & Sandboxing Best Practices
Because MCP servers grant AI assistants direct access to developer machines and enterprise backends, strict security boundaries must be enforced:
1. Read-Only Guards: Database MCP servers must use database roles with explicit `SELECT` privileges only, preventing accidental data mutations or drops.
2. Path Normalization: Filesystem MCP tools must strictly validate that requested file paths cannot escape designated project roots via `../` path traversal attacks.
3. Human-in-the-Loop Permissions: Sensitive operations (such as sending emails, deleting records, or running terminal commands) must mandate explicit user confirmation dialogs before execution.
Custom MCP Server Development
Integrate enterprise databases, CRMs, and internal APIs into Claude & Cursor.