Building MCP Servers

Create your own MCP server to expose tools and data to AI agents, then publish it to the VaultPlane registry.

Overview

An MCP server is a program that implements the Model Context Protocol. It exposes tools (actions the AI can perform), resources (data the AI can read), and prompts (templates the AI can use).

Quick Start with TypeScript

The fastest way to build an MCP server is with the official TypeScript SDK:

npm init -y && npm install @modelcontextprotocol/sdk

Create your server:

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

const server = new McpServer({
  name: "my-server",
  version: "1.0.0",
});

// Add a tool
server.tool("hello", { name: "string" }, async ({ name }) => ({
  content: [{ type: "text", text: `Hello, ${name}!` }],
}));

// Start the server
const transport = new StdioServerTransport();
await server.connect(transport);

Server Architecture

MCP servers communicate over stdio (standard input/output) or SSE (Server-Sent Events). Most servers use stdio for simplicity.

  • Tools — Functions the AI can call (e.g., query a database, create a file, send a message)
  • Resources — Data the AI can read (e.g., file contents, API responses, configurations)
  • Prompts — Reusable prompt templates that guide the AI's behavior

Best Practices

  • Declare permissions — Be explicit about what access your server needs and why.
  • Handle errors gracefully — Return clear error messages so the AI can adapt.
  • Keep tools focused — Each tool should do one thing well. Prefer multiple small tools over one large one.
  • Document everything — Good descriptions help AI agents understand when and how to use your tools.
  • Test with multiple clients — Verify your server works with Claude Desktop, Cursor, and other MCP clients.

Publishing to VaultPlane

Once your server is ready:

  1. Push your code to a public GitHub repository.
  2. Publish to npm if you want npx installation support.
  3. Go to Submit a Server on VaultPlane.
  4. Fill in the details — name, description, GitHub URL, install command.
  5. Our team will review and publish your server to the registry.

Next Steps

Building MCP Servers | VaultPlane