claude-code-skill
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-04-05
- Stars
- ★ 7
- Forks
- 1
02 资源文件 18
- 参考文档_meta.json288 B
- 脚本examples/basic-mcp.ts1.4 KB
- 脚本examples/chat-store.ts3.6 KB
- 参考文档mcp_config.example.json648 B
- 参考文档package.json838 B
- 参考文档README.md5.3 KB
- 脚本src/index.ts940 B
- 脚本src/mcp/actions.ts9.4 KB
- 脚本src/mcp/client.ts1.4 KB
- 脚本src/mcp/index.ts189 B
- 脚本src/mcp/logger.ts1.2 KB
- 脚本src/mcp/types.ts3.2 KB
- 脚本src/mcp/utils.ts477 B
- 脚本src/store/index.ts148 B
- 脚本src/store/indexeddb-storage.ts1.6 KB
- 脚本src/store/persist.ts2.2 KB
- 脚本src/store/sync.ts3.1 KB
- 参考文档tsconfig.json401 B
03 SKILL.md 正文
OpenClaw Claude Code Skill
Description
MCP (Model Context Protocol) integration for OpenClaw/Clawdbot. Use when you need to:
- Connect and orchestrate MCP tool servers (filesystem, GitHub, etc.)
- Persist state across sessions with IndexedDB/localStorage
- Sync sessions across multiple devices
Triggers: "MCP", "tool server", "sub-agent orchestration", "session sync", "state persistence", "Claude Code integration"
Installation
npm install openclaw-claude-code-skill
Core APIs
MCP Server Management
import {
initializeMcpSystem,
addMcpServer,
executeMcpAction,
getAllTools
} from "openclaw-claude-code-skill";
// 1. Initialize all configured servers
await initializeMcpSystem();
// 2. Add a new MCP server
await addMcpServer("fs", {
command: "npx",
args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
});
// 3. Get available tools
const tools = await getAllTools();
// 4. Call a tool
const result = await executeMcpAction("fs", {
method: "tools/call",
params: { name: "read_file", arguments: { path: "/tmp/test.txt" } }
});
State Persistence
import { createPersistStore, indexedDBStorage } from "openclaw-claude-code-skill";
const useStore = createPersistStore(
{ count: 0, items: [] },
(set, get) => ({
increment: () => set({ count: get().count + 1 }),
addItem: (item: string) => set({ items: [...get().items, item] })
}),
{ name: "my-store" },
indexedDBStorage // or omit for localStorage
);
// Check hydration status
if (useStore.getState()._hasHydrated) {
console.log("State restored!");
}
Session Synchronization
import { mergeSessions, mergeWithUpdate, mergeKeyValueStore } from "openclaw-claude-code-skill";
// Merge chat sessions from multiple sources
const mergedSessions = mergeSessions(localSessions, remoteSessions);
// Merge configs with timestamp-based resolution
const mergedConfig = mergeWithUpdate(localConfig, remoteConfig);
Key Functions
| Function | Purpose |
|---|---|
initializeMcpSystem() |
Start all MCP servers from config |
addMcpServer(id, config) |
Add new server dynamically |
removeMcpServer(id) |
Remove a server |
pauseMcpServer(id) |
Pause a server |
resumeMcpServer(id) |
Resume a paused server |
executeMcpAction(id, req) |
Call a tool on specific server |
getAllTools() |
List all available tools |
getClientsStatus() |
Get status of all MCP clients |
setConfigPath(path) |
Set custom config file location |
createPersistStore() |
Create Zustand store with persistence |
mergeSessions() |
Merge session arrays |
mergeWithUpdate() |
Merge with timestamp resolution |
mergeKeyValueStore() |
Merge key-value stores |
Configuration
Create mcp_config.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
"status": "active"
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_TOKEN": "your-token" },
"status": "active"
}
}
}
Set custom config path:
import { setConfigPath } from "openclaw-claude-code-skill";
setConfigPath("/path/to/mcp_config.json");
Requirements
- Node.js 18+
- TypeScript (optional but recommended)
Links
04 同仓库更多 Skills
zyfai
Earn yield on any Ethereum wallet on Base, Arbitrum, and Plasma. Use when a user wants passive DeFi yield on their funds. Deploys a non-custodial subaccount (Safe) linked to their EOA, enables automated yield optimization, and lets them deposit/withdraw anytime.
zerion-api
暂无简介
zerion-api-skill
暂无简介
zerion-api-mcp
暂无简介
yahoo-finance-forex
Fetches real-time FOREX news and market data from Yahoo Finance for major currency pairs (EUR/USD, GBP/USD, USD/JPY, etc.). Analyzes sentiment and provides trading context.
yahoo-finance
This skill should be used when the user asks to "get stock prices", "check stock quotes", "look up earnings", "get financial data", "find trending stocks", or needs stock market data from Yahoo Finance.