Scenario Word
Um servidor para o MCP scenario-word, construído com o mcp-framework.
GitHubExperimente este MCPPatrocinado
Documentação
scenario-word
Um servidor Model Context Protocol (MCP) construído com mcp-framework.
Início Rápido
# Install dependencies
npm install
# Build the project
npm run build
Estrutura do Projeto
scenario-word/
├── src/
│ ├── tools/ # MCP Tools
│ │ └── ExampleTool.ts
│ └── index.ts # Server entry point
├── package.json
└── tsconfig.json
Adicionando Componentes
O projeto vem com uma ferramenta de exemplo em src/tools/ExampleTool.ts. Você pode adicionar mais ferramentas usando a CLI:
# 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-handler
Desenvolvimento de Ferramentas
Estrutura de exemplo de ferramenta:
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;
Publicando no npm
-
Atualize seu package.json:
- Garanta que
nameseja único e siga as convenções de nomenclatura do npm - Defina
versionapropriado - Adicione
description,author,license, etc. - Verifique se
binaponta para o arquivo de entrada correto
- Garanta que
-
Compile e teste localmente:
npm run build npm link scenario-word # Test your CLI locally -
Faça login no npm (crie uma conta se necessário):
npm login -
Publique seu pacote:
npm publish
Após a publicação, os usuários podem adicioná-lo ao cliente claude desktop (leia abaixo) ou executá-lo com npx
## 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"]
}
}
}
Após a Publicação
Adicione esta configuração ao arquivo de configuração do seu Claude Desktop:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"scenario-word": {
"command": "npx",
"args": ["scenario-word"]
}
}
}
Compilando e Testando
- Faça alterações nas suas ferramentas
- Execute
npm run buildpara compilar - O servidor carregará automaticamente suas ferramentas na inicialização