Szenario-Wort
Ein mit mcp-framework erstellter Model Context Protocol (MCP)-Server.
Schnellstart
# Install dependencies
npm install
# Build the project
npm run build
Related MCP server: OmniFocus-MCP
Projektstruktur
scenario-word/
├── src/
│ ├── tools/ # MCP Tools
│ │ └── ExampleTool.ts
│ └── index.ts # Server entry point
├── package.json
└── tsconfig.jsonHinzufügen von Komponenten
Das Projekt enthält ein Beispieltool in src/tools/ExampleTool.ts . Sie können weitere Tools über die CLI hinzufügen:
# Add a new tool
mcp add tool my-tool
# Example tools you might create:
mcp add tool data-processor
mcp add tool api-client
mcp add tool file-handlerWerkzeugentwicklung
Beispielhafter Werkzeugaufbau:
import { MCPTool } from "mcp-framework";
import { z } from "zod";
interface MyToolInput {
message: string;
}
class MyTool extends MCPTool<MyToolInput> {
name = "my_tool";
description = "Describes what your tool does";
schema = {
message: {
type: z.string(),
description: "Description of this input parameter",
},
};
async execute(input: MyToolInput) {
// Your tool logic here
return `Processed: ${input.message}`;
}
}
export default MyTool;Veröffentlichen auf npm
Aktualisieren Sie Ihre package.json:
Stellen Sie sicher, dass
nameeindeutig ist und den npm-Namenskonventionen entsprichtPassende
versioneinstellendescription,author,licenseusw. hinzufügen.Überprüfen Sie, ob
binauf die richtige Eingabedatei verweist
Lokal erstellen und testen:
npm run build npm link scenario-word # Test your CLI locallyBei npm anmelden (ggf. Konto erstellen):
npm loginVeröffentlichen Sie Ihr Paket:
npm publish
Nach der Veröffentlichung können Benutzer es zu ihrem Claude-Desktop-Client hinzufügen (siehe unten) oder mit npx ausführen
## Using with Claude Desktop
### Local Development
Add this configuration to your Claude Desktop config file:
**MacOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
```json
{
"mcpServers": {
"scenario-word": {
"command": "node",
"args":["/absolute/path/to/scenario-word/dist/index.js"]
}
}
}Nach der Veröffentlichung
Fügen Sie diese Konfiguration zu Ihrer Claude Desktop-Konfigurationsdatei hinzu:
MacOS : ~/Library/Application Support/Claude/claude_desktop_config.json Windows : %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"scenario-word": {
"command": "npx",
"args": ["scenario-word"]
}
}
}Bauen und Testen
Nehmen Sie Änderungen an Ihren Werkzeugen vor
Führen Sie zum Kompilieren
npm run buildausDer Server lädt Ihre Tools beim Start automatisch