Quickstart
Create a project, serve a spec, call its tools. About ten minutes.
Where this fits: Start. The first run, before any concept; how Kervan works explains what you just ran.
On this page
Before you start
You need Node.js 22.23.3 or a later 22.x, or 24.21.0 or later. Kervan’s commands refuse older versions with one line that says so.
Create a project
You need Node.js 22.23.3 or a later 22.x, or 24.21.0 or later. To build Kervan from a clone instead, see Development in the repository's README.
npm create kervan@latest my-server
cd my-server
npm run devThe project has two tools in TypeScript, a test, and scripts for dev, start, build and
test. npm run dev serves it with hot reload and, in a terminal, a small REPL that calls tools
the way a client would: type tools, then call one. In another terminal, in the project:
npm testServe a spec
A spec declares tools without code. This one has two tools backed by the public Open-Meteo APIs (no
API key needed). Save it as kervan.yaml:
# yaml-language-server: $schema=../../packages/spec-runtime/schema/kervan.schema.json
specVersion: 1
name: open-meteo
version: 0.1.0
description: Weather and city lookup backed by the public Open-Meteo APIs (no API key needed).
defaults:
http: { timeoutMs: 8000, maxResponseBytes: 262144 }
rateLimit: { perMinute: 30, concurrency: 5 }
tools:
- name: search_city
title: Search city
description: Finds up to 5 places by name and returns their coordinates.
annotations: { readOnlyHint: true }
input:
type: object
properties:
name: { type: string, minLength: 2, maxLength: 100, description: "City name, e.g. Ankara" }
required: [name]
http:
url: https://geocoding-api.open-meteo.com/v1/search
query: { name: "{{input.name}}", count: 5, language: en, format: json }
output:
# Only the fields the model needs; never the whole API response.
select: "results[].{name: name, country: country, latitude: latitude, longitude: longitude}"
- name: get_current_weather
title: Current weather
description: Current temperature (°C), wind speed (km/h) and WMO weather code at a coordinate.
annotations: { readOnlyHint: true }
input:
type: object
properties:
latitude: { type: number, minimum: -90, maximum: 90 }
longitude: { type: number, minimum: -180, maximum: 180 }
required: [latitude, longitude]
http:
url: https://api.open-meteo.com/v1/forecast
query:
latitude: "{{input.latitude}}"
longitude: "{{input.longitude}}"
current: temperature_2m,wind_speed_10m,weather_code
output:
select: "{temperatureC: current.temperature_2m, windKmh: current.wind_speed_10m, weatherCode: current.weather_code}"
schema:
type: object
properties:
temperatureC: { type: number }
windKmh: { type: number }
weatherCode: { type: integer }
required: [temperatureC, windKmh, weatherCode]Then serve it over Streamable HTTP:
npx kervan@latest run kervan.yaml --httpLoaded open-meteo 0.1.0: 2 tool(s)
Serving open-meteo on http://127.0.0.1:3000/mcpAny MCP client can connect to http://127.0.0.1:3000/mcp now. Without --http, kervan run
serves stdio instead, which is what a client that starts the server itself (Claude Code, for
example) uses. Stop it with Ctrl+C.
Call the tools from a REPL
kervan dev serves the same spec with hot reload and, in a terminal, the REPL:
npx kervan@latest dev kervan.yamlType tools, then call one. The result is the real answer from Open-Meteo, so yours shows today’s
weather:
kervan> tools
search_city Finds up to 5 places by name and returns their coordinates.
get_current_weather Current temperature (°C), wind speed (km/h) and WMO weather code at a coordinate.
kervan> call get_current_weather {"latitude": 39.92, "longitude": 32.85}
{"temperatureC":21.2,"windKmh":6.2,"weatherCode":2}
structured: {"temperatureC":21.2,"windKmh":6.2,"weatherCode":2}Edit kervan.yaml while it runs: kervan dev reloads it, and keeps the last good version when an
edit is invalid.
Connect a client
To use the server from Claude Code, add it as a stdio server with the absolute path of the spec:
claude mcp add open-meteo -- npx kervan@latest run /absolute/path/to/kervan.yamlThe Claude Code guide covers HTTP servers, scopes and checking the connection.
Add Kervan to a project you have
npm install @kervan/core@latest @kervan/transport@latest
npm install --save-dev kervan@latestFrom source
To run the repository’s latest code instead of the published packages, build it from a clone (pnpm comes with Node.js through Corepack):
git clone https://github.com/orchesta/getkervan.git kervan
cd kervan
corepack enable
pnpm install
pnpm buildFrom a clone, run the CLI as node packages/cli/bin/kervan.js <command>, and pnpm try:new <dir>
creates a project from the local packages.