Vyriy Preset - MCP

Calm MCP server preset for exposing package knowledge and tools through a small Vyriy HTTP boundary.

This repository is a Yarn workspace monorepo with one runtime workspace: workspaces/mcp. The HTTP boundary stays explicit: @vyriy/router selects the /mcp endpoint, @vyriy/handler wraps shared API behavior, and @vyriy/server runs the Node HTTP server.

Create this example

npm create vyriy@latest

Choose the mcp preset.

Workspace Layout

workspaces/
  mcp/
    bin/build.sh         Production bundle script.
    bin/start.sh         Local server script.
    index.ts             Server entry point.
    mcp.ts               MCP server and hello_world tool registration.
    server.ts            HTTP handler, router, and transport wiring.
    types.ts             Small MCP tool contracts.

Request Flow

The MCP workspace exposes a Streamable HTTP endpoint:

  1. @vyriy/server starts the Node HTTP server.
  2. @vyriy/router routes /mcp requests to the MCP handler.
  3. @vyriy/handler applies shared API headers and healthcheck behavior.
  4. workspaces/mcp connects the MCP SDK transport.
  5. The generated hello_world tool handles a typed tool call.

The generated server keeps the MCP protocol inside a normal Vyriy HTTP runtime instead of hiding it behind framework magic.

The default MCP endpoint is:

http://localhost:3000/mcp

The healthcheck endpoint is:

http://localhost:3000/healthcheck

Development

Install dependencies with Yarn 4 and Node.js 24 or newer:

yarn install

Start the MCP server workspace:

yarn start:mcp

Override the bind address or port when needed:

HOST=0.0.0.0 PORT=3003 yarn start:mcp

Call the generated hello_world tool:

curl -s http://localhost:3000/mcp \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"hello_world","arguments":{"name":"Vyriy"}}}'

The tool returns:

Hello, Vyriy!

Build the production MCP artifact:

yarn build:mcp

Run Storybook documentation:

yarn storybook

Validation

Run all checks:

yarn check

Run checks separately:

yarn lint
yarn build
yarn test

Focused Jest validation can target the MCP workspace:

yarn jest workspaces/mcp --runInBand --coverage=false

Documentation

  • workspaces/mcp/README.md documents the HTTP server and transport boundary.
  • workspaces/mcp/mcp.ts registers the default hello_world tool.
  • Matching doc.mdx files render project and workspace README files in Storybook.

As the project grows, the inline starter tool can be extracted into package-level tools with their own README files and tests.

Project Guidance

These articles describe the development approach behind this preset and provide practical guidance for evolving a project on top of it: