@action8/mcp
v0.0.3
Published
MCP server for Claude / Cursor and other AI Agents, providing two-step query capabilities: - `search_actions`: Search for site / page / element / scenario metadata - `get_action_by_id`: Get complete content by ID (Markdown, optional JSON)
Readme
Action8 MCP Server
MCP server for Claude / Cursor and other AI Agents, providing two-step query capabilities:
search_actions: Search for site / page / element / scenario metadataget_action_by_id: Get complete content by ID (Markdown, optional JSON)
Installation & Running
Using Published Package
npx @action8/mcp --api-url http://localhost:3100Using Local Source (Monorepo)
# Build
pnpm -C packages/mcp build
# Run
node packages/mcp/dist/cli.js --api-url http://localhost:3100Configuration
Environment variables and CLI arguments (CLI arguments take precedence over environment variables):
| Env Variable | CLI Argument | Description | Default |
|---|---|---|---|
| ACTION8_API_URL | --api-url <url> | API service URL | https://api.action8.io |
| ACTION8_API_KEY | --api-key <key> | API Key | - |
| ACTION8_LOG_LEVEL | --log-level <level> | Log level (debug/info/warn/error) | info |
| ACTION8_TIMEOUT | --timeout <ms> | Request timeout (ms) | 30000 |
| ACTION8_RETRY_MAX | --retry-max <n> | Max retry attempts | 3 |
| ACTION8_RETRY_DELAY | --retry-delay <ms> | Retry delay (ms) | 1000 |
| ACTION8_TRANSPORT | --transport <type> | Transport mode (stdio/http) | stdio |
| ACTION8_HTTP_PORT | --http-port <port> | HTTP server port (http mode only) | 3001 |
| ACTION8_HTTP_HOST | --http-host <host> | HTTP server host (http mode only) | 0.0.0.0 |
| ACTION8_HTTP_CORS | --http-cors <origins> | CORS origins (comma-separated, http mode only) | * |
Example Usage
Using environment variables:
export ACTION8_API_URL=http://localhost:3100
export ACTION8_API_KEY=your-key
export ACTION8_LOG_LEVEL=debug
npx @action8/mcpUsing CLI arguments:
npx @action8/mcp --api-url http://localhost:3100 --api-key your-key --log-level debugUsing HTTP transport:
# Environment variables
export ACTION8_TRANSPORT=http
export ACTION8_HTTP_PORT=3001
npx @action8/mcp
# CLI arguments (overrides environment)
npx @action8/mcp --transport http --http-port 3001 --http-host localhostDevelopment & Publishing
1. Local Development & Debugging
Claude Desktop Configuration (Recommended) Use absolute path to reference local build artifacts for stability:
{
"mcpServers": {
"action8-local": {
"command": "node",
"args": [
"/absolute/path/to/action8/packages/mcp/dist/cli.js",
"--api-url", "http://localhost:3000"
]
}
}
}Tip: Use pnpm -C packages/mcp build --watch to enable watch mode. Changes will auto-compile (Claude restart required).
Using npm link
cd packages/mcp
npm link
# Test command
action8-mcp --help2. Publish to NPM
cd packages/mcp
# 1. Login
npm login
# 2. Update version
npm version patch # 0.1.0 → 0.1.1 (bug fix)
npm version minor # 0.1.0 → 0.2.0 (new feature)
npm version major # 0.1.0 → 1.0.0 (breaking change)
# 3. Build and publish (prepublishOnly auto-runs build)
npm publish3. Install Published Version
# Global install (for CLI)
npm install -g @action8/mcp
# Or as project dependency
npm install @action8/mcp
# Or run directly with npx (no install needed)
npx @action8/mcp --api-url http://localhost:3100If previously used npm link, clean up before installing:
npm rm -g @action8/mcp
npm cache clean --force
npm install -g @action8/mcp4. Monorepo Internal Integration Testing
No publishing needed. Reference directly in other workspaces (e.g., services/action-builder):
- Add dependency to
package.json:"@action8/mcp": "workspace:*" - Write test scripts:
import { Action8McpServer } from '@action8/mcp';
// ...use class for integration testingMCP Client Configuration
Claude Desktop
{
"mcpServers": {
"action8": {
"command": "npx",
"args": ["-y", "@action8/mcp", "--api-url", "http://localhost:3100"],
"env": {
"ACTION8_API_KEY": "your-key"
}
}
}
}Cursor
{
"mcpServers": {
"action8": {
"command": "npx",
"args": ["-y", "@action8/mcp", "--api-url", "http://localhost:3100"]
}
}
}Test Coverage
- Core libs: config/protocol/errors/logger/formatter/schema/types/api-client
- Tools: search_actions / get_action_by_id
- Server: tool registration and invocation
- Integration: local HTTP stub to verify tool calls with actual API client
