
zcaceres/easy-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
zcaceres/easy-mcpは、https://github.com/zcaceres/easy-mcp.からインポートされたMCPサーバー候補です。
概要
zcaceres/easy-mcpは、https://github.com/zcaceres/easy-mcp.からインポートされたMCPサーバー候補です。
概要(AI 翻訳)
EasyMCPはベータ版ですが使えます。問題があれば報告してください。
EasyMCPは、TypeScriptでモデルコンテキストプロトコル(MCP)サーバーを作成する最も簡単な方法です。
配管やフォーマット、その他の定型的な定義を単純な宣言の裏に隠しています。
Easy MCPは、始めるために必要な最低限のものを定義できます。または、より複雑なリソース、テンプレート、ツール、プロンプトを定義することもできます。
特徴
- シンプルなExpressに似たAPI:EasyMCPは高レベルで直感的なAPIを提供します。ツール、プロンプト、リソース、リソーステンプレート、ルートをExpressJSのエンドポイント定義に似た呼び出しで定義できます。任意のパラメータはすべてオプションで、必要でない限り隠されています。
- 実験的デコレーターAPI:ツール、プロンプト、リソースの引数を自動的に推論します。入力スキーマ定義は不要です!
- コンテキストオブジェクト:ツール内のコンテキストオブジェクトを通じてログや進捗報告などのMCP機能にアクセスできます。
- 優れた型別安全:より良いDXと実行時エラーの減少。
ベータ制限
- MCPサンプリングのサポートはまだありません
- まだSSEのサポートはありません
- リソース更新通知はまだありません
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
easy-mcp
EasyMCP is usable but in beta. Please report any issues you encounter.
EasyMCP is the simplest way to create Model Context Protocol (MCP) servers in TypeScript.
It hides the plumbing, formatting, and other boilerplate definitions behind simple declarations.
Easy MCP allows you to define the bare minimum of what you need to get started. Or you can define more complex resources, templates, tools, and prompts.
Features
- Simple Express-like API: EasyMCP provides a high-level, intuitive API. Define Tools, Prompts, Resources, Resource Templates, and Roots with calls similar to defining endpoints in ExpressJS. Every possible parameter that could be optional is optional and hidden unless you need it.
- Experimental Decorators API: Automagically infers tool, prompt, and resource arguments. No input schema definition required!
- Context Object: Access MCP capabilities like logging and progress reporting through a context object in your tools.
- Great Type Safety: Better DX and fewer runtime errors.
Beta Limitations
- No support for MCP sampling, yet
- No support for SSE, yet
- No resource update notifications, yet
- Prompts technically accept inputs, but the Typescript SDK suggests they can’t. So this functionality feels unfinished.
Installation
To install EasyMCP, run the following command in your project directory:
bun install
Quick Start with (Experimental) Decorators API
Also see examples/express-decorators.ts or run bun start:decorators
EasyMCP’s decorator API is dead simple and infers types and input configuration automatically.
But it’s experimental and may change or have not-yet-discovered problems.
import EasyMCP from "./lib/EasyMCP";
import { Tool, Resource, Prompt } from "./lib/experimental/decorators";
class MyMCP extends EasyMCP {
@Resource("greeting/{name}")
getGreeting(name: string) {
return `Hello, ${name}!`;
}
@Prompt()
greetingPrompt(name: string) {
return `Generate a greeting for ${name}.`;
}
@Tool()
greet(name: string, optionalContextFromServer: Context) {
optionalContextFromServer.info(`Greeting ${name}`);
return `Hello, ${name}!`;
}
}
const mcp = new MyMCP({ version: "1.0.0" });
Complex Example with Decorators API
See examples/express-express.ts or run bun start:express
import EasyMCP from "./lib/EasyMCP";
import { Prompt } from "./lib/decorators/Prompt";
import { Resource } from "./lib/decorators/Resource";
import { Root } from "./lib/decorators/Root";
import { Tool } from "./lib/decorators/Tool";
@Root("/my-sample-dir/photos")
@Root("/my-root-dir", { name: "My laptop's root directory" }) // Optionally you can name the root
class ZachsMCP extends EasyMCP {
/**
You can declare a Tool with zero configuration. Relevant types and plumbing will be inferred and handled.
By default, the name of the Tool will be the name of the method.
*/
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →