Skip to content

Commit 25ff4bb

Browse files
committed
feat: add WebMCP client module and update agent skills for AI integration
1 parent 24468f2 commit 25ff4bb

6 files changed

Lines changed: 147 additions & 0 deletions

File tree

site/docusaurus.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const config: Config = {
2727
locales: ['en'],
2828
},
2929

30+
clientModules: [require.resolve('./src/clientModules/webmcp.ts')],
31+
3032
plugins: [
3133
[
3234
'@easyops-cn/docusaurus-search-local',

site/src/clientModules/webmcp.ts

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// WebMCP: expose raid docs tools to AI agents via the browser
2+
// https://webmachinelearning.github.io/webmcp/
3+
export function onRouteDidUpdate(): void {
4+
if (typeof navigator === 'undefined' || !('modelContext' in navigator)) {
5+
return;
6+
}
7+
8+
(navigator as any).modelContext.provideContext({
9+
tools: [
10+
{
11+
name: 'navigate_to_docs',
12+
description: 'Navigate to a section of the raid documentation.',
13+
inputSchema: {
14+
type: 'object',
15+
properties: {
16+
section: {
17+
type: 'string',
18+
enum: ['overview', 'usage', 'features', 'examples', 'references', 'whats-new'],
19+
description: 'The documentation section to navigate to.',
20+
},
21+
},
22+
required: ['section'],
23+
},
24+
execute: async ({ section }: { section: string }) => {
25+
const paths: Record<string, string> = {
26+
'overview': '/docs/overview',
27+
'usage': '/docs/category/usage',
28+
'features': '/docs/category/features',
29+
'examples': '/docs/category/examples',
30+
'references': '/docs/category/references',
31+
'whats-new': '/docs/whats-new',
32+
};
33+
window.location.href = paths[section] ?? '/docs/overview';
34+
},
35+
},
36+
{
37+
name: 'get_install_command',
38+
description: 'Returns the command to install raid on the current platform.',
39+
inputSchema: {
40+
type: 'object',
41+
properties: {
42+
platform: {
43+
type: 'string',
44+
enum: ['macos', 'linux', 'windows'],
45+
description: 'Target platform.',
46+
},
47+
},
48+
required: ['platform'],
49+
},
50+
execute: async ({ platform }: { platform: string }) => {
51+
const commands: Record<string, string> = {
52+
macos: 'brew install 8bitalex/tap/raid',
53+
linux: 'curl -sSL https://github.com/8bitalex/raid/releases/latest/download/raid_linux_amd64.tar.gz | tar -xz && sudo mv raid /usr/local/bin/',
54+
windows: 'scoop bucket add 8bitalex https://github.com/8bitalex/scoop-bucket && scoop install raid',
55+
};
56+
return commands[platform] ?? commands.macos;
57+
},
58+
},
59+
],
60+
});
61+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://agentskills.io/schema/v0.2.0/index.schema.json",
3+
"skills": [
4+
{
5+
"name": "raid-mcp-server",
6+
"type": "mcp",
7+
"description": "MCP stdio server exposing raid tools for managing multi-repo development environments. Install raid and run `raid context serve` to activate.",
8+
"url": "https://raidcli.dev/.well-known/mcp/server-card.json"
9+
}
10+
]
11+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"linkset": [
3+
{
4+
"anchor": "https://raidcli.dev/",
5+
"service-doc": [
6+
{ "href": "https://raidcli.dev/docs", "type": "text/html" }
7+
],
8+
"describedby": [
9+
{ "href": "https://raidcli.dev/docs/references/schema", "type": "text/html" }
10+
]
11+
}
12+
]
13+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"schemaVersion": "1.0",
3+
"serverInfo": {
4+
"name": "raid",
5+
"version": "0.7.4-beta",
6+
"description": "Distributed development environment orchestrator. Manages multi-repo workflows, environments, and tasks via an MCP stdio server."
7+
},
8+
"transport": [
9+
{
10+
"type": "stdio",
11+
"command": "raid context serve"
12+
}
13+
],
14+
"capabilities": {
15+
"tools": [
16+
{ "name": "raid_install", "description": "Clone repositories and run install tasks for the active profile" },
17+
{ "name": "raid_env_switch", "description": "Switch to a named environment and run its tasks" },
18+
{ "name": "raid_run_task", "description": "Execute a named command from the active profile" },
19+
{ "name": "raid_list_profiles", "description": "List all available profiles" },
20+
{ "name": "raid_list_repos", "description": "List repositories in the active profile" },
21+
{ "name": "raid_describe_repo", "description": "Get details about a specific repository by name or path" }
22+
]
23+
},
24+
"documentation": "https://raidcli.dev/docs/usage/context"
25+
}

site/static/robots.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# All crawlers: allow full site
2+
User-agent: *
3+
Allow: /
4+
Disallow:
5+
6+
# AI search agents: explicitly welcome
7+
User-agent: GPTBot
8+
Allow: /
9+
10+
User-agent: OAI-SearchBot
11+
Allow: /
12+
13+
User-agent: Claude-Web
14+
Allow: /
15+
16+
User-agent: Google-Extended
17+
Allow: /
18+
19+
User-agent: Applebot-Extended
20+
Allow: /
21+
22+
User-agent: PerplexityBot
23+
Allow: /
24+
25+
# AI training crawlers: disallowed
26+
User-agent: CCBot
27+
Disallow: /
28+
29+
User-agent: anthropic-ai
30+
Disallow: /
31+
32+
# Content usage preferences (https://contentsignals.org/)
33+
Content-Signal: ai-train=no, search=yes, ai-input=yes
34+
35+
Sitemap: https://raidcli.dev/sitemap.xml

0 commit comments

Comments
 (0)