Skip to main content
Glama
0xstyles

MCP Server Template

by 0xstyles

MCP Server Template

Minimal template for building Model Context Protocol (MCP) servers with Bun and TypeScript.

Quick Start

bun install
bun run dev    # Development
bun run start  # Production

Configure in Cursor

{
  "mcpServers": {
    "my-mcp-server": {
      "command": "bun",
      "args": ["/path/to/your/project/index.ts"],
      "cwd": "/path/to/your/project"
    }
  }
}

Related MCP server: MCP Server Starter

Project Structure

├── index.ts          # Server entry point
├── schema.ts         # State schema (Zod)
├── config.ts         # Configuration
├── state.yaml        # State file
├── tools/            # Tool handlers
└── utils/            # State & logging utilities

Features

  • Schema-based state validation (Zod)

  • YAML state persistence

  • Tool usage logging

  • Deep merge for state updates

Usage

Customize State

  1. Update schema.ts to match your state structure

  2. State is automatically validated on read/write

Add Tools

  1. Create tools/your-tool.ts following example-tool.ts pattern

  2. Register in index.ts: registerYourTool(server);

State Operations

import { getState, updateState, saveState } from "./utils/state.ts";
import { type State } from "./schema.ts";

const state = await getState();
await updateState({ version: "1.0.1" }); // Deep merge
await saveState(newState); // Full replacement

Logging

import { log } from "./utils/logger.ts";
await log("info", "tool_name", request, response);

See TEMPLATE.md for detailed examples.

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A modern, lightning-fast starter template for building Model Context Protocol applications with Bun, enabling developers to create MCP servers with TypeScript support, validation, and environment configuration.
    8
    2
    MIT
  • F
    license
    B
    quality
    D
    maintenance
    A minimal TypeScript starter template for building Model Context Protocol (MCP) servers with auto-loading architecture for tools, resources, and prompts. Includes code generators, dual transport support (stdio/HTTP), and production-ready structure.
    3
  • F
    license
    -
    quality
    -
    maintenance
    A minimal, production-ready TypeScript template for building Model Context Protocol servers with auto-loading architecture for tools, resources, and prompts, supporting both stdio and HTTP transports.
  • F
    license
    -
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server template designed for building structured tools, prompts, and resources with built-in support for HTTP and STDIO transports. It provides a standardized framework for developers to create and deploy AI-driven services using TypeScript and Zod schema validation.
    9

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • MCP (Model Context Protocol) server for Appwrite

  • A Model Context Protocol server for Wix AI tools

View all MCP Connectors

Latest Blog Posts

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/0xstyles/mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server