Skip to content

Commit e6c1d7d

Browse files
committed
attempt mcp fix
1 parent 16e04c6 commit e6c1d7d

9 files changed

Lines changed: 116 additions & 1076 deletions

File tree

‎MCP_SERVER.md‎

Lines changed: 0 additions & 175 deletions
This file was deleted.

‎README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ Files in the `static` directory will be accessible from the base URL. For exampl
6666

6767
To speed up load times, we use `webp` images. To convert `png` files to `webp` files, run `pnpm webp`. You will need to have [`cwebp`](https://developers.google.com/speed/webp/download) installed for this to work.
6868

69+
### MCP Server
70+
71+
The documentation is available via an [MCP (Model Context Protocol)](https://modelcontextprotocol.io) server for AI assistants:
72+
73+
- **HTTP API**: `https://docs.juicebox.money/api/mcp`
74+
- **Documentation**: See [`mcp-server/README.md`](./mcp-server/README.md) for setup and API reference
75+
- **Developer Guide**: See [MCP Server Guide](/docs/dev/v5/build/mcp-server.md)
76+
6977
### Contact
7078

7179
If you would like to contribute or have questions, you can make an issue here on GitHub, join our [Discord server](https://discord.gg/juicebox), or [contact us via juicebox.money](https://juicebox.money/contact).

‎api/mcp/[...path].js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ import express from "express";
66
import cors from "cors";
77
import fs from "fs/promises";
88
import path from "path";
9-
import { fileURLToPath } from "url";
109
import matter from "gray-matter";
1110
import removeMarkdown from "remove-markdown";
1211
import Fuse from "fuse.js";
1312

14-
const __filename = fileURLToPath(import.meta.url);
15-
const __dirname = path.dirname(__filename);
16-
const PROJECT_ROOT = path.resolve(__dirname, "../..");
13+
// Use process.cwd() for Vercel compatibility (works in both CJS and ESM)
14+
const PROJECT_ROOT = process.cwd();
1715
const INDEX_FILE = path.join(PROJECT_ROOT, "mcp-server/src/docs-index.json");
1816

1917
let docIndex = [];

0 commit comments

Comments
 (0)