Integrations
Provides a pre-defined prompt for generating Git commit messages based on changes or diff information.
sova
A TypeScript framework for building MCP servers capable of handling client sessions.
Note
For a Python implementation, see sova.
Features
- Simple Tool, Resource, Prompt definition
- Authentication
- Sessions
- Image content
- Audio content
- Logging
- Error handling
- SSE
- CORS (enabled by default)
- Progress notifications
- Typed server events
- Prompt argument auto-completion
- Sampling
- Automated SSE pings
- Roots
- CLI for testing and debugging
Installation
Quickstart
Note
There are many real-world examples of using sova in the wild. See the Showcase for examples.
That's it! You have a working MCP server.
You can test the server in terminal with:
SSE
Server-Sent Events (SSE) provide a mechanism for servers to send real-time updates to clients over an HTTPS connection. In the context of MCP, SSE is primarily used to enable remote MCP communication, allowing an MCP hosted on a remote machine to be accessed and relay updates over the network.
You can also run the server with SSE support:
This will start the server and listen for SSE connections on http://localhost:8080/sse
.
You can then use SSEClientTransport
to connect to the server:
Core Concepts
Tools
Tools in MCP allow servers to expose executable functions that can be invoked by clients and used by LLMs to perform actions.
sova uses the Standard Schema specification for defining tool parameters. This allows you to use your preferred schema validation library (like Zod, ArkType, or Valibot) as long as it implements the spec.
Zod Example:
ArkType Example:
Valibot Example:
Valibot requires the peer dependency @valibot/to-json-schema.
Returning a string
execute
can return a string:
The latter is equivalent to:
Returning a list
If you want to return a list of messages, you can return an object with a content
property:
Returning an image
Use the imageContent
to create a content object for an image:
The imageContent
function takes the following options:
url
: The URL of the image.path
: The path to the image file.buffer
: The image data as a buffer.
Only one of url
, path
, or buffer
must be specified.
The above example is equivalent to:
Returning an audio
Use the audioContent
to create a content object for an audio:
The audioContent
function takes the following options:
url
: The URL of the audio.path
: The path to the audio file.buffer
: The audio data as a buffer.
Only one of url
, path
, or buffer
must be specified.
The above example is equivalent to:
Return combination type
You can combine various types in this way and send them back to AI
Logging
Tools can log messages to the client using the log
object in the context object:
The log
object has the following methods:
debug(message: string, data?: SerializableValue)
error(message: string, data?: SerializableValue)
info(message: string, data?: SerializableValue)
warn(message: string, data?: SerializableValue)
Errors
The errors that are meant to be shown to the user should be thrown as UserError
instances:
Progress
Tools can report progress by calling reportProgress
in the context object:
Tool Annotations
As of the MCP Specification (2025-03-26), tools can include annotations that provide richer context and control by adding metadata about a tool's behavior:
The available annotations are:
Annotation | Type | Default | Description |
---|---|---|---|
title | string | - | A human-readable title for the tool, useful for UI display |
readOnlyHint | boolean | false | If true, indicates the tool does not modify its environment |
destructiveHint | boolean | true | If true, the tool may perform destructive updates (only meaningful when readOnlyHint is false) |
idempotentHint | boolean | false | If true, calling the tool repeatedly with the same arguments has no additional effect (only meaningful when readOnlyHint is false) |
openWorldHint | boolean | true | If true, the tool may interact with an "open world" of external entities |
These annotations help clients and LLMs better understand how to use the tools and what to expect when calling them.
Resources
Resources represent any kind of data that an MCP server wants to make available to clients. This can include:
- File contents
- Screenshots and images
- And more
Each resource is identified by a unique URI and can contain either text or binary data.
Note
load
can return multiple resources. This could be used, for example, to return a list of files inside a directory when the directory is read.
You can also return binary contents in load
:
Resource templates
You can also define resource templates:
Resource template argument auto-completion
Provide complete
functions for resource template arguments to enable automatic completion:
Prompts
Prompts enable servers to define reusable prompt templates and workflows that clients can easily surface to users and LLMs. They provide a powerful way to standardize and share common LLM interactions.
Prompt argument auto-completion
Prompts can provide auto-completion for their arguments:
Prompt argument auto-completion using enum
If you provide an enum
array for an argument, the server will automatically provide completions for the argument.
Authentication
sova allows you to authenticate
clients using a custom function:
Now you can access the authenticated session data in your tools:
Providing Instructions
You can provide instructions to the server using the instructions
option:
Sessions
The session
object is an instance of sovaSession
and it describes active client sessions.
We allocate a new server instance for each client connection to enable 1:1 communication between a client and the server.
Typed server events
You can listen to events emitted by the server using the on
method:
sovaSession
sovaSession
represents a client session and provides methods to interact with the client.
Refer to Sessions for examples of how to obtain a sovaSession
instance.
requestSampling
requestSampling
creates a sampling request and returns the response.
clientCapabilities
The clientCapabilities
property contains the client capabilities.
loggingLevel
The loggingLevel
property describes the logging level as set by the client.
roots
The roots
property contains the roots as set by the client.
server
The server
property contains an instance of MCP server that is associated with the session.
Typed session events
You can listen to events emitted by the session using the on
method:
Running Your Server
Test with mcp-cli
The fastest way to test and debug your server is with sova dev
:
This will run your server with mcp-cli
for testing and debugging your MCP server in the terminal.
Inspect with MCP Inspector
Another way is to use the official MCP Inspector
to inspect your server with a Web UI:
FAQ
How to use with Claude Desktop?
Follow the guide https://modelcontextprotocol.io/quickstart/user and add the following configuration:
Acknowledgements
- sova is inspired by the Python implementation by Jonathan Lowin.
- Parts of codebase were adopted from LiteMCP.
- Parts of codebase were adopted from Model Context protocolでSSEをやってみる.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A TypeScript framework for building MCP servers with features for client sessions, authentication, image/audio content, and typed server events.
Related MCP Servers
- AsecurityAlicenseAqualityA TypeScript-based server that allows calling other MCP clients from your own MCP client, facilitating task delegation and context window offloading for enhanced multi-agent interactions.Last updated -314JavaScriptMIT License
- AsecurityFlicenseAqualityA TypeScript-based MCP server designed for experimentation and integration with Calude Desktop and Cursor IDE, offering a modular playground for extending server capabilities.Last updated -21,2614JavaScript
- -securityFlicense-qualityA TypeScript framework for building Model Context Protocol (MCP) servers with automatic discovery and loading of tools, resources, and prompts.Last updated -67TypeScript
- -securityFlicense-qualityA simple TypeScript library for creating Model Context Protocol (MCP) servers with features like type safety, parameter validation, and a minimal code API.Last updated -1TypeScriptMIT License