Content
# Shendao Engine OpenAPI MCP Toolkit
[](https://smithery.ai/server/@box3lab/engine-openapi-mcp)
This project provides a set of tools for the Shendao Engine's OpenAPI MCP (Model Context Protocol), helping AI to efficiently call engine interfaces.
## Feature Overview
The toolkit offers the following core functionalities:
- **Script Management Tools**: For creating, updating, and renaming game scripts
- **Storage Management Tools**: For reading, writing, deleting, and querying game data storage
- **AI Assistance Features**: Providing code review, generation, optimization, and data structure design based on large models
## API Tool Details
### Script Management Tools
#### Basic Operations
| Tool Name | Description | Required Parameters |
| ---------------------- | ------------------------------- | ------------------------------------------ |
| `script.saveOrUpdate` | Save or update Shendao Engine script | `mapId`, `name`, `type`, `file` |
| `script.rename` | Rename Shendao Engine script | `mapId`, `name`, `newName` |
#### Code Assistance Prompts
| Prompt Name | Description | Required Parameters |
| --------------------- | ------------------------------------------------------ | ------------------------ |
| `script.review` | Review Shendao Engine script code, providing improvement suggestions and potential issue analysis | `code` |
| `script.generate` | Generate Shendao Engine script code based on description and requirements | `description` |
| `script.optimize` | Optimize Shendao Engine script code for performance or readability | `code` |
### Storage Management Tools
#### Basic Operations
| Tool Name | Description | Required Parameters |
| ------------------ | --------------------------------- | ------------------------------------------------ |
| `storage.get` | Query a single key value in storage | `key`, `mapId`, `storageName` |
| `storage.set` | Write/update a single key value in storage | `key`, `mapId`, `storageName`, `value` |
| `storage.remove` | Delete a single key value in storage | `key`, `mapId`, `storageName` |
| `storage.page` | Paginated query in storage | `mapId`, `storageName` |
#### Storage Assistance Prompts
| Prompt Name | Description | Required Parameters |
| -------------------------- | --------------------------------------- | ----------------------------------------- |
| `storage.designSchema` | Design key-value data storage structure for game features | `gameFeatures` |
| `storage.migrationPlan` | Design a data migration plan | `currentSchema`, `targetSchema` |
| `storage.optimizeQuery` | Optimize key-value data query plan | `queryDescription` |
## Usage Examples
### Script Management Example
```javascript
// Upload script file
const scriptResult = await mcpClient.callTool("script.saveOrUpdate", {
mapId: "your-map-id",
name: "example.js",
type: "0", // 0-Server script, 1-Client script
file: "console.log('hi')",
token: "your-auth-token",
userAgent: "your-user-agent",
});
// Use code review prompt
const codeReview = await mcpClient.prompt("script.review", {
code: "function example() { console.log('Hello'); }",
});
// Generate script code
const generatedCode = await mcpClient.prompt("script.generate", {
description: "Implement a system to calculate player scores",
requirements: "Support multiple scoring methods, save the highest score, support leaderboards",
});
```
### Storage Management Example
```javascript
// Read storage value
const storageData = await mcpClient.callTool("storage.get", {
key: "player_stats",
mapId: "your-map-id",
storageName: "gameData",
token: "your-auth-token",
userAgent: "your-user-agent",
});
// Write storage value
const writeResult = await mcpClient.callTool("storage.set", {
key: "player_stats",
mapId: "your-map-id",
storageName: "gameData",
value: JSON.stringify({ score: 100, level: 5 }),
token: "your-auth-token",
userAgent: "your-user-agent",
});
// Use data structure design prompt
const schemaDesign = await mcpClient.prompt("storage.designSchema", {
gameFeatures: "An RPG game that needs to store player equipment, backpack items, quest progress, and achievements",
dataRequirements: "Support multiple players online, support offline progress saving, support item transaction history",
});
```
## Integration into Client
### Browser Integration
```javascript
import { McpClient } from "@modelcontextprotocol/sdk/client/index.js";
// Initialize client
const mcpClient = new McpClient({
serverUrl: "https://your-mcp-server.com",
headers: {
"Content-Type": "application/json",
},
});
// Use tools
async function useTools() {
const result = await mcpClient.callTool("storage.get", {
// Parameters...
});
// Process result
console.log(result);
}
```
### Node.js Integration
```javascript
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { WebSocketClientTransport } from "@modelcontextprotocol/sdk/client/websocket.js";
// Create transport channel
const transport = new WebSocketClientTransport({
url: "ws://localhost:3000",
});
// Initialize client
const client = new Client(
{ name: "dao3-client", version: "1.0.0" },
{ capabilities: { tools: {} } }
);
// Connect to server
await client.connect(transport);
// Use tools
const result = await client.callTool({
name: "script.list",
arguments: {
mapId: "your-map-id",
token: "your-token",
userAgent: "your-agent",
},
});
```
## Authentication
All API calls require authentication information, including:
- `token`: Authorization token
- `userAgent`: User agent string
These parameters need to be provided with each tool call.
### Obtaining Authentication Information
1. Visit the Shendao Engine Developer Platform to obtain a developer key
2. Use the developer key to generate an authentication token
3. Provide authentication information in API calls
## Troubleshooting
### Request Timeout
If a request times out, it may be due to:
- Unstable network connection
- High server load
- Excessive request data volume
Try reducing the request data volume or retrying later.
### Type Errors
Ensure that parameters are passed according to the types specified in the documentation, especially:
- Numeric parameters (e.g., limit, offset) must be numbers
- Boolean parameters (e.g., isGroup) must be boolean values
## Contribution Guidelines
We welcome issue reports or Pull Requests to help improve this project.
1. Fork the project repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Create a Pull Request
You Might Also Like
Ollama
Ollama enables easy access to large language models on various platforms.

n8n
n8n is a secure workflow automation platform for technical teams with 400+...
OpenWebUI
Open WebUI is an extensible web interface for customizable applications.

Dify
Dify is a platform for AI workflows, enabling file uploads and self-hosting.

Zed
Zed is a high-performance multiplayer code editor from the creators of Atom.
MarkItDown MCP
markitdown-mcp is a lightweight MCP server for converting various URIs to Markdown.