# Vyriy Preset MCP

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

Published: 2026-06-19
Tags: vyriy, preset, mcp, cli, ai-agents
Source: https://vyriy.dev/examples/vyriy-preset-mcp/

---

# 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

```bash
npm create vyriy@latest
```

Choose the `mcp` preset.

## Workspace Layout

```text
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:

```txt
http://localhost:3000/mcp
```

The healthcheck endpoint is:

```txt
http://localhost:3000/healthcheck
```

## Development

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

```bash
yarn install
```

Start the MCP server workspace:

```bash
yarn start:mcp
```

Override the bind address or port when needed:

```bash
HOST=0.0.0.0 PORT=3003 yarn start:mcp
```

Call the generated `hello_world` tool:

```bash
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:

```txt
Hello, Vyriy!
```

Build the production MCP artifact:

```bash
yarn build:mcp
```

Run Storybook documentation:

```bash
yarn storybook
```

## Validation

Run all checks:

```bash
yarn check
```

Run checks separately:

```bash
yarn lint
yarn build
yarn test
```

Focused Jest validation can target the MCP workspace:

```bash
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:

- [Vyriy MCP: calm interface between packages and AI agents](https://vyriy.dev/examples/vyriy-mcp-server/) - how MCP fits into the Vyriy HTTP boundary with explicit tool registration.
- [From Static Sites to MCP: The Vyriy Server Family](https://vyriy.dev/blog/from-static-sites-to-mcp-the-vyriy-server-family/) - how `@vyriy/server`, `@vyriy/handler`, `@vyriy/router`, and `@vyriy/static` compose across static and server use cases.
- [Calm App Structure for the Vyriy Ecosystem](https://vyriy.dev/blog/vyriy-calm-app-structure/) - a practical project structure for Vyriy applications: shared configs, small packages, thin workspaces, Storybook docs, tests, and deployable entry points.
- [Storybook as Project Documentation](https://vyriy.dev/blog/storybook-as-project-documentation/) - how to use Storybook as living project documentation and a component playground.
