Skip to content

Commit 5f3b2a7

Browse files
committed
feat: mcp server + refactor
1 parent 8771f56 commit 5f3b2a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+546
-12024
lines changed

apps/mcp-server/package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "@ooxml-dev/mcp-server",
3+
"private": true,
4+
"version": "0.0.1",
5+
"type": "module",
6+
"main": "./src/index.ts",
7+
"scripts": {
8+
"dev": "wrangler dev",
9+
"build": "wrangler deploy --dry-run",
10+
"deploy": "wrangler deploy",
11+
"typecheck": "tsc --noEmit"
12+
},
13+
"dependencies": {
14+
"@ooxml-dev/shared": "workspace:*"
15+
},
16+
"devDependencies": {
17+
"@cloudflare/workers-types": "^4.20241230.0",
18+
"typescript": "~5.9.3",
19+
"wrangler": "^4.0.0"
20+
}
21+
}

apps/mcp-server/src/index.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// ECMA-376 Spec MCP Server
2+
// Cloudflare Worker entry point
3+
4+
export interface Env {
5+
DATABASE_URL: string;
6+
OPENAI_API_KEY?: string;
7+
}
8+
9+
export default {
10+
async fetch(request: Request, _env: Env, _ctx: ExecutionContext): Promise<Response> {
11+
const url = new URL(request.url);
12+
13+
// Health check
14+
if (url.pathname === "/health") {
15+
return new Response(JSON.stringify({ status: "ok" }), {
16+
headers: { "Content-Type": "application/json" },
17+
});
18+
}
19+
20+
// MCP endpoint (to be implemented)
21+
if (url.pathname === "/mcp") {
22+
return new Response(
23+
JSON.stringify({
24+
error: "MCP server not yet implemented",
25+
tools: ["search_ecma_spec", "get_section", "get_context", "list_parts"],
26+
}),
27+
{
28+
status: 501,
29+
headers: { "Content-Type": "application/json" },
30+
},
31+
);
32+
}
33+
34+
return new Response("ECMA-376 Spec MCP Server", {
35+
headers: { "Content-Type": "text/plain" },
36+
});
37+
},
38+
};

apps/mcp-server/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": true,
5+
"types": ["@cloudflare/workers-types"]
6+
},
7+
"include": ["src"]
8+
}

apps/mcp-server/wrangler.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name = "ecma-spec-mcp"
2+
main = "src/index.ts"
3+
compatibility_date = "2024-12-30"
4+
5+
# NeonDB connection (set via wrangler secret)
6+
# wrangler secret put DATABASE_URL
7+
8+
# Embedding API keys (set via wrangler secret)
9+
# wrangler secret put OPENAI_API_KEY
File renamed without changes.

apps/web/package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "@ooxml-dev/web",
3+
"private": true,
4+
"version": "0.1.3",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"preview": "vite preview",
10+
"typecheck": "tsc --noEmit",
11+
"deploy": "bun run build && wrangler pages deploy dist --project-name=ooxml-dev"
12+
},
13+
"dependencies": {
14+
"clsx": "^2.1.1",
15+
"fumadocs-core": "^16.4.7",
16+
"fumadocs-ui": "^16.4.7",
17+
"jszip": "^3.10.1",
18+
"lucide-react": "^0.562.0",
19+
"react": "^19.2.3",
20+
"react-dom": "^19.2.3",
21+
"react-router-dom": "^7.12.0"
22+
},
23+
"devDependencies": {
24+
"@tailwindcss/vite": "^4.1.18",
25+
"@types/node": "^22.0.0",
26+
"@types/react": "^19.2.8",
27+
"@types/react-dom": "^19.2.3",
28+
"@vitejs/plugin-react": "^5.1.2",
29+
"tailwindcss": "^4.1.18",
30+
"typescript": "~5.9.3",
31+
"vite": "^7.3.1",
32+
"wrangler": "^4.0.0"
33+
}
34+
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)