DEV Community

Cover image for Coputo — Build Remote MCP Server in Seconds with TypeScript
Junichi Takahashi
Junichi Takahashi

Posted on

Coputo — Build Remote MCP Server in Seconds with TypeScript

Why MCP matters

The Model Context Protocol (MCP) is an open standard that lets AI agents talk to external tools through a clean JSON-RPC interface—think of it as a USB-C port for LLMs and apps instead of yet-another bespoke REST API.

Meet Coputo

Coputo - The TypeScript Remote MCP Server Framework

Coputo is a TypeScript framework that helps you build remote MCP server in a few lines of code.

  • ⚡️ Fast build-time DX – powered by a modern TypeScript stack.
  • 🔐 Tenant-scoped credential storage – a built-in endpoint keeps API keys encrypted server-side.
  • 🪄 Batteries-included examples – so you can curl a working server in minutes.

Quickstart

npm create coputo@latest
cd my-coputo-server
npm run dev
Enter fullscreen mode Exit fullscreen mode

That’s literally all you need to boot an MCP endpoint locally.

Below is the entire code for a working “echo” MCP server. Notice how Coputo keeps everything typed with zod and handles the JSON-RPC plumbing for you.

import { z } from 'zod';
import fastify from 'fastify';
import coputo, { buildMcpToolInputSchema, replySuccess } from 'coputo';

const app = fastify();

const EchoSchema = z.object({ text: z.string() });

app.register(coputo, {
  mcpServers: [
    {
      name: 'echo',
      tools: [
        {
          schema: {
            name: 'echo:text',
            description: 'Echo back the provided text.',
            inputSchema: buildMcpToolInputSchema({ zodSchema: EchoSchema }),
          },
          inputZodSchema: EchoSchema,
          async run({ args }) {
            return replySuccess({ data: args.text });
          },
        },
      ],
    },
  ],
});

app.listen({ port: 3000 });
Enter fullscreen mode Exit fullscreen mode
POST http://localhost:3000/api/mcp
Content-Type: application/json
Accept: application/json

{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "tools/call",
  "params": {
    "name": "echo:text",
    "arguments": { "text": "hi dev.to 👋" }
  }
}
Enter fullscreen mode Exit fullscreen mode
{ "jsonrpc": "2.0", "id": "1", "result": "hi dev.to 👋" }
Enter fullscreen mode Exit fullscreen mode

Built-in multi-tenant secret storage

Multi-tenant secret storage

Real-world tools usually need API tokens.
Coputo ships with an HTTP endpoint that encrypts & stores those tokens per tenant.

POST /api/mcpServerAdapterTokens
Content-Type: application/json
Accept: application/json

{
  "name": "openai",
  "token": "sk-********"
}
Enter fullscreen mode Exit fullscreen mode

Coputo stays out of your way but lets you plug in your own cipher key, IdP/JWT verification, and database store.

Set and get credentials in Production

Under the hood

Piece What Coputo uses
Server [Fastify] for speed & plugin ecosystem
Types Full end-to-end TypeScript with zod schemas
Protocol JSON-RPC 2.0 bindings that follow the MCP spec
Security AES-256 encryption (configurable) for stored tokens
Testing Vitest out of the box

Roadmap

  1. Web UI for tenant management (tokens & usage metrics)
  2. Adapters for Stripe, GitHub, Notion, and more out of the box
  3. Edge deployment recipes (Cloudflare Workers, Vercel, Fly)

PRs and GitHub Stars are welcome! 🌟

Get involved

Final thoughts

If you’re playing with agents, tool calling, or just want a type-safe home for that baby MCP server idea, give Coputo a whirl.
I’d love to hear what you build—drop a comment or open an issue anytime.

Happy hacking! 🛠️✨

Top comments (0)