chatgrid-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +157 -0
- package/dist/bin/chatgrid-mcp.d.ts +3 -0
- package/dist/bin/chatgrid-mcp.d.ts.map +1 -0
- package/dist/bin/chatgrid-mcp.js +5 -0
- package/dist/bin/chatgrid-mcp.js.map +1 -0
- package/dist/src/client.d.ts +73 -0
- package/dist/src/client.d.ts.map +1 -0
- package/dist/src/client.js +117 -0
- package/dist/src/client.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +264 -0
- package/dist/src/index.js.map +1 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# chatgrid-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for [ChatGrid](https://chatgrid.ai) — give your AI assistant access to your team's project knowledge boards.
|
|
4
|
+
|
|
5
|
+
Works with Claude Code, Claude Desktop, and any MCP-compatible client.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx chatgrid-mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Setup
|
|
14
|
+
|
|
15
|
+
### 1. Get your API key
|
|
16
|
+
|
|
17
|
+
Go to [chatgrid.ai/settings/api-keys](https://chatgrid.ai/settings/api-keys) and create an API key.
|
|
18
|
+
|
|
19
|
+
### 2. Configure Claude Code
|
|
20
|
+
|
|
21
|
+
Add to your project's `.mcp.json`:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"chatgrid": {
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": ["-y", "chatgrid-mcp"],
|
|
29
|
+
"env": {
|
|
30
|
+
"CHATGRID_API_KEY": "your-api-key-here"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Or for Claude Desktop, add to `claude_desktop_config.json`:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"mcpServers": {
|
|
42
|
+
"chatgrid": {
|
|
43
|
+
"command": "npx",
|
|
44
|
+
"args": ["-y", "chatgrid-mcp"],
|
|
45
|
+
"env": {
|
|
46
|
+
"CHATGRID_API_KEY": "your-api-key-here"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Environment variables
|
|
54
|
+
|
|
55
|
+
| Variable | Required | Description |
|
|
56
|
+
| ------------------ | -------- | -------------------------------------------------------------- |
|
|
57
|
+
| `CHATGRID_API_KEY` | Yes | Your ChatGrid API key |
|
|
58
|
+
| `CHATGRID_API_URL` | No | Override the API base URL (default: `https://api.chatgrid.ai`) |
|
|
59
|
+
|
|
60
|
+
## Available tools
|
|
61
|
+
|
|
62
|
+
### Board Management
|
|
63
|
+
|
|
64
|
+
#### `list_boards`
|
|
65
|
+
|
|
66
|
+
List all boards the user has access to.
|
|
67
|
+
|
|
68
|
+
**Example:** "What boards do I have on ChatGrid?"
|
|
69
|
+
|
|
70
|
+
#### `create_board`
|
|
71
|
+
|
|
72
|
+
Create a new project board.
|
|
73
|
+
|
|
74
|
+
| Parameter | Type | Required | Description |
|
|
75
|
+
| --------- | ------ | -------- | ---------------------- |
|
|
76
|
+
| `name` | string | Yes | Name for the new board |
|
|
77
|
+
|
|
78
|
+
**Example:** "Create a new ChatGrid board called 'Backend Architecture'"
|
|
79
|
+
|
|
80
|
+
### Knowledge Management
|
|
81
|
+
|
|
82
|
+
#### `add_resource`
|
|
83
|
+
|
|
84
|
+
Add a YouTube video, URL, or text document to a board. Automatically vectorizes the content for AI search.
|
|
85
|
+
|
|
86
|
+
| Parameter | Type | Required | Description |
|
|
87
|
+
| ---------- | ---------------------------------- | -------- | ------------------------------- |
|
|
88
|
+
| `board_id` | string | Yes | Board ID to add the resource to |
|
|
89
|
+
| `type` | `"youtube"` \| `"url"` \| `"text"` | Yes | Resource type |
|
|
90
|
+
| `content` | string | Yes | URL or text content |
|
|
91
|
+
| `label` | string | No | Optional label for the resource |
|
|
92
|
+
|
|
93
|
+
**Example:** "Add this YouTube video to my Architecture board: https://youtube.com/watch?v=..."
|
|
94
|
+
|
|
95
|
+
#### `search_board`
|
|
96
|
+
|
|
97
|
+
Semantic search across all content on a board.
|
|
98
|
+
|
|
99
|
+
| Parameter | Type | Required | Description |
|
|
100
|
+
| ---------- | ------ | -------- | ----------------------------- |
|
|
101
|
+
| `board_id` | string | Yes | Board ID to search |
|
|
102
|
+
| `query` | string | Yes | Search query |
|
|
103
|
+
| `limit` | number | No | Max results (1-20, default 5) |
|
|
104
|
+
|
|
105
|
+
**Example:** "Search my Architecture board for anything about database sharding"
|
|
106
|
+
|
|
107
|
+
#### `ask_board`
|
|
108
|
+
|
|
109
|
+
Ask an AI question grounded in the board's knowledge. Searches the board first, then generates an answer based on the found content.
|
|
110
|
+
|
|
111
|
+
| Parameter | Type | Required | Description |
|
|
112
|
+
| ---------- | ------ | -------- | --------------------- |
|
|
113
|
+
| `board_id` | string | Yes | Board ID to ask about |
|
|
114
|
+
| `question` | string | Yes | Question to ask |
|
|
115
|
+
|
|
116
|
+
**Example:** "Based on my Architecture board, what database should we use for the user service?"
|
|
117
|
+
|
|
118
|
+
### Node Operations
|
|
119
|
+
|
|
120
|
+
#### `add_note`
|
|
121
|
+
|
|
122
|
+
Add a quick note, decision, or learning to a board.
|
|
123
|
+
|
|
124
|
+
| Parameter | Type | Required | Description |
|
|
125
|
+
| ---------- | ------ | -------- | --------------------------- |
|
|
126
|
+
| `board_id` | string | Yes | Board ID to add the note to |
|
|
127
|
+
| `content` | string | Yes | Note content |
|
|
128
|
+
| `label` | string | No | Optional label |
|
|
129
|
+
|
|
130
|
+
**Example:** "Add a note to my Architecture board: Decided to use PostgreSQL for the user service"
|
|
131
|
+
|
|
132
|
+
#### `list_nodes`
|
|
133
|
+
|
|
134
|
+
List all nodes on a board with their types and labels.
|
|
135
|
+
|
|
136
|
+
| Parameter | Type | Required | Description |
|
|
137
|
+
| ---------- | ------ | -------- | -------------------------- |
|
|
138
|
+
| `board_id` | string | Yes | Board ID to list nodes for |
|
|
139
|
+
|
|
140
|
+
**Example:** "What's on my Architecture board?"
|
|
141
|
+
|
|
142
|
+
## Development
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Install dependencies
|
|
146
|
+
npm install
|
|
147
|
+
|
|
148
|
+
# Build
|
|
149
|
+
npm run build
|
|
150
|
+
|
|
151
|
+
# Watch mode
|
|
152
|
+
npm run dev
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## License
|
|
156
|
+
|
|
157
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatgrid-mcp.d.ts","sourceRoot":"","sources":["../../bin/chatgrid-mcp.ts"],"names":[],"mappings":";AAIA,OAAO,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatgrid-mcp.js","sourceRoot":"","sources":["../../bin/chatgrid-mcp.ts"],"names":[],"mappings":";AAEA,0EAA0E;AAC1E,2DAA2D;AAC3D,OAAO,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChatGrid API client.
|
|
3
|
+
* Makes HTTP calls to the ChatGrid REST API at https://api.chatgrid.ai/v1.
|
|
4
|
+
*/
|
|
5
|
+
interface ClientOptions {
|
|
6
|
+
apiKey: string;
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Board {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
created_at: string;
|
|
13
|
+
updated_at: string;
|
|
14
|
+
is_public: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface Node {
|
|
17
|
+
id: string;
|
|
18
|
+
node_type: string;
|
|
19
|
+
position_x: number;
|
|
20
|
+
position_y: number;
|
|
21
|
+
node_data: Record<string, unknown>;
|
|
22
|
+
parent_node_id: string | null;
|
|
23
|
+
created_at: string;
|
|
24
|
+
updated_at: string;
|
|
25
|
+
}
|
|
26
|
+
export interface Chat {
|
|
27
|
+
id: string;
|
|
28
|
+
title: string;
|
|
29
|
+
node_id: string | null;
|
|
30
|
+
created_at: string;
|
|
31
|
+
updated_at: string;
|
|
32
|
+
last_message_at: string | null;
|
|
33
|
+
}
|
|
34
|
+
export interface Message {
|
|
35
|
+
id: string;
|
|
36
|
+
role: string;
|
|
37
|
+
content: string;
|
|
38
|
+
model: string | null;
|
|
39
|
+
created_at: string;
|
|
40
|
+
metadata: Record<string, unknown> | null;
|
|
41
|
+
}
|
|
42
|
+
export interface SearchResult {
|
|
43
|
+
id: string;
|
|
44
|
+
content: string;
|
|
45
|
+
node_id: string;
|
|
46
|
+
metadata: Record<string, unknown>;
|
|
47
|
+
score: number;
|
|
48
|
+
}
|
|
49
|
+
export interface VectorizeResult {
|
|
50
|
+
board_id: string;
|
|
51
|
+
node_id: string | null;
|
|
52
|
+
chunks_stored: number;
|
|
53
|
+
}
|
|
54
|
+
export declare class ChatGridClient {
|
|
55
|
+
private apiKey;
|
|
56
|
+
private baseUrl;
|
|
57
|
+
constructor(options: ClientOptions);
|
|
58
|
+
listBoards(): Promise<Board[]>;
|
|
59
|
+
createBoard(name: string): Promise<Board>;
|
|
60
|
+
listNodes(boardId: string): Promise<Node[]>;
|
|
61
|
+
createNode(boardId: string, type: string, data: Record<string, unknown>, label?: string): Promise<Node>;
|
|
62
|
+
vectorize(boardId: string, content: string, nodeId?: string, metadata?: Record<string, unknown>): Promise<VectorizeResult>;
|
|
63
|
+
searchDocuments(boardId: string, query: string, limit?: number): Promise<SearchResult[]>;
|
|
64
|
+
createChat(boardId: string, title: string): Promise<Chat>;
|
|
65
|
+
deleteChat(boardId: string, chatId: string): Promise<void>;
|
|
66
|
+
sendMessage(boardId: string, chatId: string, content: string): Promise<Message>;
|
|
67
|
+
private request;
|
|
68
|
+
private get;
|
|
69
|
+
private post;
|
|
70
|
+
private delete;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAuBD,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE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,GACR,OAAO,CAAC,YAAY,EAAE,CAAC;IAUpB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzD,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM1D,WAAW,CACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC;YAUL,OAAO;YAkCP,GAAG;YAIH,IAAI;YAIJ,MAAM;CAGrB"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChatGrid API client.
|
|
3
|
+
* Makes HTTP calls to the ChatGrid REST API at https://api.chatgrid.ai/v1.
|
|
4
|
+
*/
|
|
5
|
+
const DEFAULT_BASE_URL = "https://api.chatgrid.ai";
|
|
6
|
+
// -- Client --
|
|
7
|
+
export class ChatGridClient {
|
|
8
|
+
apiKey;
|
|
9
|
+
baseUrl;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.apiKey = options.apiKey;
|
|
12
|
+
this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
13
|
+
}
|
|
14
|
+
// ── Boards ──
|
|
15
|
+
async listBoards() {
|
|
16
|
+
const res = await this.get("/v1/boards");
|
|
17
|
+
return res.data;
|
|
18
|
+
}
|
|
19
|
+
async createBoard(name) {
|
|
20
|
+
const res = await this.post("/v1/boards", { name });
|
|
21
|
+
return res.data;
|
|
22
|
+
}
|
|
23
|
+
// ── Nodes ──
|
|
24
|
+
async listNodes(boardId) {
|
|
25
|
+
const nodes = [];
|
|
26
|
+
let cursor = null;
|
|
27
|
+
let hasMore = true;
|
|
28
|
+
while (hasMore) {
|
|
29
|
+
const path = cursor
|
|
30
|
+
? `/v1/boards/${boardId}/nodes?limit=50&cursor=${encodeURIComponent(cursor)}`
|
|
31
|
+
: `/v1/boards/${boardId}/nodes?limit=50`;
|
|
32
|
+
const res = await this.get(path);
|
|
33
|
+
nodes.push(...res.data);
|
|
34
|
+
cursor = res.cursor;
|
|
35
|
+
hasMore = res.has_more;
|
|
36
|
+
}
|
|
37
|
+
return nodes;
|
|
38
|
+
}
|
|
39
|
+
async createNode(boardId, type, data, label) {
|
|
40
|
+
const nodeData = { ...data };
|
|
41
|
+
if (label) {
|
|
42
|
+
nodeData.label = label;
|
|
43
|
+
}
|
|
44
|
+
const res = await this.post(`/v1/boards/${boardId}/nodes`, {
|
|
45
|
+
type,
|
|
46
|
+
position: {
|
|
47
|
+
x: Math.floor(Math.random() * 800),
|
|
48
|
+
y: Math.floor(Math.random() * 600),
|
|
49
|
+
},
|
|
50
|
+
data: nodeData,
|
|
51
|
+
});
|
|
52
|
+
return res.data;
|
|
53
|
+
}
|
|
54
|
+
// ── Documents ──
|
|
55
|
+
async vectorize(boardId, content, nodeId, metadata) {
|
|
56
|
+
const body = { content };
|
|
57
|
+
if (nodeId)
|
|
58
|
+
body.node_id = nodeId;
|
|
59
|
+
if (metadata)
|
|
60
|
+
body.metadata = metadata;
|
|
61
|
+
const res = await this.post(`/v1/boards/${boardId}/documents/vectorize`, body);
|
|
62
|
+
return res.data;
|
|
63
|
+
}
|
|
64
|
+
async searchDocuments(boardId, query, limit = 5) {
|
|
65
|
+
const res = await this.post(`/v1/boards/${boardId}/documents/search`, { query, limit });
|
|
66
|
+
return res.data;
|
|
67
|
+
}
|
|
68
|
+
// ── Chats ──
|
|
69
|
+
async createChat(boardId, title) {
|
|
70
|
+
const res = await this.post(`/v1/boards/${boardId}/chats`, { title });
|
|
71
|
+
return res.data;
|
|
72
|
+
}
|
|
73
|
+
async deleteChat(boardId, chatId) {
|
|
74
|
+
await this.delete(`/v1/boards/${boardId}/chats/${chatId}`);
|
|
75
|
+
}
|
|
76
|
+
// ── Messages ──
|
|
77
|
+
async sendMessage(boardId, chatId, content) {
|
|
78
|
+
const res = await this.post(`/v1/boards/${boardId}/chats/${chatId}/messages`, { content, stream: false });
|
|
79
|
+
return res.data;
|
|
80
|
+
}
|
|
81
|
+
// ── HTTP helpers ──
|
|
82
|
+
async request(method, path, body) {
|
|
83
|
+
const url = `${this.baseUrl}${path}`;
|
|
84
|
+
const headers = {
|
|
85
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
86
|
+
"Content-Type": "application/json",
|
|
87
|
+
"User-Agent": "chatgrid-mcp/0.1.0",
|
|
88
|
+
};
|
|
89
|
+
const init = { method, headers };
|
|
90
|
+
if (body !== undefined) {
|
|
91
|
+
init.body = JSON.stringify(body);
|
|
92
|
+
}
|
|
93
|
+
const response = await fetch(url, init);
|
|
94
|
+
if (!response.ok) {
|
|
95
|
+
let errorMessage;
|
|
96
|
+
try {
|
|
97
|
+
const errorBody = (await response.json());
|
|
98
|
+
errorMessage = `ChatGrid API error (${response.status}): ${errorBody.message}`;
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
errorMessage = `ChatGrid API error (${response.status}): ${response.statusText}`;
|
|
102
|
+
}
|
|
103
|
+
throw new Error(errorMessage);
|
|
104
|
+
}
|
|
105
|
+
return (await response.json());
|
|
106
|
+
}
|
|
107
|
+
async get(path) {
|
|
108
|
+
return this.request("GET", path);
|
|
109
|
+
}
|
|
110
|
+
async post(path, body) {
|
|
111
|
+
return this.request("POST", path, body);
|
|
112
|
+
}
|
|
113
|
+
async delete(path) {
|
|
114
|
+
await this.request("DELETE", path);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AA+EnD,eAAe;AAEf,MAAM,OAAO,cAAc;IACjB,MAAM,CAAS;IACf,OAAO,CAAS;IAExB,YAAY,OAAsB;QAChC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YAAY,GAAG,uBAAuB,QAAQ,CAAC,MAAM,MAAM,SAAS,CAAC,OAAO,EAAE,CAAC;YACjF,CAAC;YAAC,MAAM,CAAC;gBACP,YAAY,GAAG,uBAAuB,QAAQ,CAAC,MAAM,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;YACnF,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAM,CAAC;IACtC,CAAC;IAEO,KAAK,CAAC,GAAG,CAAI,IAAY;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAI,KAAK,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IAEO,KAAK,CAAC,IAAI,CAAI,IAAY,EAAE,IAAa;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAI,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IAEO,KAAK,CAAC,MAAM,CAAC,IAAY;QAC/B,MAAM,IAAI,CAAC,OAAO,CAAU,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAwCpE,wBAAgB,YAAY,IAAI,SAAS,CAyTxC"}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { ChatGridClient } from "./client.js";
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Initialization
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
function createClient() {
|
|
9
|
+
const apiKey = process.env.CHATGRID_API_KEY;
|
|
10
|
+
if (!apiKey) {
|
|
11
|
+
console.error("CHATGRID_API_KEY environment variable is required. " +
|
|
12
|
+
"Get your API key from https://chatgrid.ai/settings/api-keys");
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
return new ChatGridClient({
|
|
16
|
+
apiKey,
|
|
17
|
+
baseUrl: process.env.CHATGRID_API_URL,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function textResult(text) {
|
|
21
|
+
return { content: [{ type: "text", text }] };
|
|
22
|
+
}
|
|
23
|
+
function errorResult(message) {
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
26
|
+
isError: true,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Server setup
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
export function createServer() {
|
|
33
|
+
const client = createClient();
|
|
34
|
+
const server = new McpServer({
|
|
35
|
+
name: "chatgrid-mcp",
|
|
36
|
+
version: "0.1.0",
|
|
37
|
+
});
|
|
38
|
+
// ── list_boards ──
|
|
39
|
+
server.tool("list_boards", "List all project boards the user has access to", {}, async () => {
|
|
40
|
+
try {
|
|
41
|
+
const boards = await client.listBoards();
|
|
42
|
+
if (boards.length === 0) {
|
|
43
|
+
return textResult("No boards found. Create one with the create_board tool.");
|
|
44
|
+
}
|
|
45
|
+
const summary = boards
|
|
46
|
+
.map((b) => `- ${b.name} (id: ${b.id})`)
|
|
47
|
+
.join("\n");
|
|
48
|
+
return textResult(`Found ${boards.length} board(s):\n\n${summary}`);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
console.error("[list_boards]", err);
|
|
52
|
+
return errorResult(err instanceof Error ? err.message : String(err));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
// ── create_board ──
|
|
56
|
+
server.tool("create_board", "Create a new project knowledge board", { name: z.string().describe("Name for the new board") }, async ({ name }) => {
|
|
57
|
+
try {
|
|
58
|
+
const board = await client.createBoard(name);
|
|
59
|
+
return textResult(`Board created successfully.\n\nName: ${board.name}\nID: ${board.id}`);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
console.error("[create_board]", err);
|
|
63
|
+
return errorResult(err instanceof Error ? err.message : String(err));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
// ── add_resource ──
|
|
67
|
+
server.tool("add_resource", "Add a YouTube video, URL, or text document to a board. Automatically vectorizes the content for AI search.", {
|
|
68
|
+
board_id: z.string().describe("Board ID to add the resource to"),
|
|
69
|
+
type: z
|
|
70
|
+
.enum(["youtube", "url", "text"])
|
|
71
|
+
.describe("Resource type: youtube, url, or text"),
|
|
72
|
+
content: z
|
|
73
|
+
.string()
|
|
74
|
+
.describe("The URL (for youtube/url types) or text content (for text type)"),
|
|
75
|
+
label: z
|
|
76
|
+
.string()
|
|
77
|
+
.optional()
|
|
78
|
+
.describe("Optional label for the resource node"),
|
|
79
|
+
}, async ({ board_id, type, content, label }) => {
|
|
80
|
+
try {
|
|
81
|
+
// Determine node type
|
|
82
|
+
const nodeType = type === "youtube" ? "youtube" : "document";
|
|
83
|
+
// Create a node on the board
|
|
84
|
+
const nodeData = {};
|
|
85
|
+
if (type === "youtube" || type === "url") {
|
|
86
|
+
nodeData.url = content;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
nodeData.text = content;
|
|
90
|
+
}
|
|
91
|
+
nodeData.sourceType = type;
|
|
92
|
+
const node = await client.createNode(board_id, nodeType, nodeData, label);
|
|
93
|
+
// Vectorize the content
|
|
94
|
+
const textToVectorize = type === "text"
|
|
95
|
+
? content
|
|
96
|
+
: `Source: ${content}\n\nThis resource was added via MCP. Content will be fetched and vectorized when the ChatGrid processing pipeline runs.`;
|
|
97
|
+
const vectorResult = await client.vectorize(board_id, textToVectorize, node.id, {
|
|
98
|
+
sourceType: type,
|
|
99
|
+
sourceUrl: type !== "text" ? content : undefined,
|
|
100
|
+
label: label ?? undefined,
|
|
101
|
+
});
|
|
102
|
+
return textResult(`Resource added successfully.\n\n` +
|
|
103
|
+
`Node ID: ${node.id}\n` +
|
|
104
|
+
`Type: ${type}\n` +
|
|
105
|
+
`Chunks stored: ${vectorResult.chunks_stored}\n` +
|
|
106
|
+
(label ? `Label: ${label}\n` : ""));
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
console.error("[add_resource]", err);
|
|
110
|
+
return errorResult(err instanceof Error ? err.message : String(err));
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
// ── search_board ──
|
|
114
|
+
server.tool("search_board", "Semantic search across all content on a board. Returns matching content chunks with source info.", {
|
|
115
|
+
board_id: z.string().describe("Board ID to search"),
|
|
116
|
+
query: z.string().describe("Search query"),
|
|
117
|
+
limit: z
|
|
118
|
+
.number()
|
|
119
|
+
.int()
|
|
120
|
+
.min(1)
|
|
121
|
+
.max(20)
|
|
122
|
+
.optional()
|
|
123
|
+
.default(5)
|
|
124
|
+
.describe("Max results to return (1-20, default 5)"),
|
|
125
|
+
}, async ({ board_id, query, limit }) => {
|
|
126
|
+
try {
|
|
127
|
+
const results = await client.searchDocuments(board_id, query, limit);
|
|
128
|
+
if (results.length === 0) {
|
|
129
|
+
return textResult("No matching content found for that query.");
|
|
130
|
+
}
|
|
131
|
+
const formatted = results
|
|
132
|
+
.map((r, i) => {
|
|
133
|
+
const source = r.node_id ? `Node: ${r.node_id}` : "Unknown source";
|
|
134
|
+
const score = (r.score * 100).toFixed(1);
|
|
135
|
+
return `### Result ${i + 1} (${score}% match)\nSource: ${source}\n\n${r.content}`;
|
|
136
|
+
})
|
|
137
|
+
.join("\n\n---\n\n");
|
|
138
|
+
return textResult(`Found ${results.length} result(s):\n\n${formatted}`);
|
|
139
|
+
}
|
|
140
|
+
catch (err) {
|
|
141
|
+
console.error("[search_board]", err);
|
|
142
|
+
return errorResult(err instanceof Error ? err.message : String(err));
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
// ── ask_board ──
|
|
146
|
+
server.tool("ask_board", "Ask an AI question grounded in the board's knowledge. Searches the board first, then generates an answer based on the found content.", {
|
|
147
|
+
board_id: z.string().describe("Board ID to ask about"),
|
|
148
|
+
question: z.string().describe("Question to ask"),
|
|
149
|
+
}, async ({ board_id, question }) => {
|
|
150
|
+
let chatId = null;
|
|
151
|
+
try {
|
|
152
|
+
// 1. Search for relevant context
|
|
153
|
+
const results = await client.searchDocuments(board_id, question, 5);
|
|
154
|
+
// 2. Build context-enriched question
|
|
155
|
+
let enrichedQuestion;
|
|
156
|
+
if (results.length > 0) {
|
|
157
|
+
const context = results
|
|
158
|
+
.map((r, i) => `[Source ${i + 1}]\n${r.content}`)
|
|
159
|
+
.join("\n\n");
|
|
160
|
+
enrichedQuestion =
|
|
161
|
+
`Answer the following question using ONLY the context provided. ` +
|
|
162
|
+
`If the context doesn't contain enough information, say so.\n\n` +
|
|
163
|
+
`## Context\n\n${context}\n\n## Question\n\n${question}`;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
enrichedQuestion =
|
|
167
|
+
`No relevant content was found on this board for the question. ` +
|
|
168
|
+
`Please let the user know and answer based on general knowledge if possible.\n\n` +
|
|
169
|
+
`Question: ${question}`;
|
|
170
|
+
}
|
|
171
|
+
// 3. Create a temporary chat
|
|
172
|
+
const chat = await client.createChat(board_id, `MCP Query: ${question.slice(0, 50)}`);
|
|
173
|
+
chatId = chat.id;
|
|
174
|
+
// 4. Send the message and get the AI response
|
|
175
|
+
const response = await client.sendMessage(board_id, chatId, enrichedQuestion);
|
|
176
|
+
// 5. Clean up: delete the temporary chat
|
|
177
|
+
try {
|
|
178
|
+
await client.deleteChat(board_id, chatId);
|
|
179
|
+
}
|
|
180
|
+
catch (cleanupErr) {
|
|
181
|
+
console.error("[ask_board] cleanup failed:", cleanupErr);
|
|
182
|
+
// Non-fatal: answer was already obtained
|
|
183
|
+
}
|
|
184
|
+
const sourceInfo = results.length > 0
|
|
185
|
+
? `\n\n---\n_Based on ${results.length} source(s) from the board._`
|
|
186
|
+
: "\n\n---\n_No board content matched. Answer is based on general knowledge._";
|
|
187
|
+
return textResult(response.content + sourceInfo);
|
|
188
|
+
}
|
|
189
|
+
catch (err) {
|
|
190
|
+
// Attempt cleanup on error too
|
|
191
|
+
if (chatId) {
|
|
192
|
+
try {
|
|
193
|
+
await client.deleteChat(board_id, chatId);
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
// Ignore cleanup errors
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
console.error("[ask_board]", err);
|
|
200
|
+
return errorResult(err instanceof Error ? err.message : String(err));
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
// ── add_note ──
|
|
204
|
+
server.tool("add_note", "Add a quick note, decision, or learning to a board as a text node on the canvas", {
|
|
205
|
+
board_id: z.string().describe("Board ID to add the note to"),
|
|
206
|
+
content: z.string().describe("Note content"),
|
|
207
|
+
label: z.string().optional().describe("Optional label for the note"),
|
|
208
|
+
}, async ({ board_id, content, label }) => {
|
|
209
|
+
try {
|
|
210
|
+
const node = await client.createNode(board_id, "note", { text: content }, label);
|
|
211
|
+
// Also vectorize the note so it appears in search
|
|
212
|
+
await client.vectorize(board_id, content, node.id, {
|
|
213
|
+
sourceType: "note",
|
|
214
|
+
label: label ?? undefined,
|
|
215
|
+
});
|
|
216
|
+
return textResult(`Note added successfully.\n\nNode ID: ${node.id}` +
|
|
217
|
+
(label ? `\nLabel: ${label}` : ""));
|
|
218
|
+
}
|
|
219
|
+
catch (err) {
|
|
220
|
+
console.error("[add_note]", err);
|
|
221
|
+
return errorResult(err instanceof Error ? err.message : String(err));
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
// ── list_nodes ──
|
|
225
|
+
server.tool("list_nodes", "List all nodes on a board with their types and labels", {
|
|
226
|
+
board_id: z.string().describe("Board ID to list nodes for"),
|
|
227
|
+
}, async ({ board_id }) => {
|
|
228
|
+
try {
|
|
229
|
+
const nodes = await client.listNodes(board_id);
|
|
230
|
+
if (nodes.length === 0) {
|
|
231
|
+
return textResult("This board has no nodes yet.");
|
|
232
|
+
}
|
|
233
|
+
const formatted = nodes
|
|
234
|
+
.map((n) => {
|
|
235
|
+
const label = n.node_data?.label ??
|
|
236
|
+
n.node_data?.title ??
|
|
237
|
+
"";
|
|
238
|
+
const labelStr = label ? ` - ${label}` : "";
|
|
239
|
+
return `- [${n.node_type}] ${n.id}${labelStr}`;
|
|
240
|
+
})
|
|
241
|
+
.join("\n");
|
|
242
|
+
return textResult(`Found ${nodes.length} node(s):\n\n${formatted}`);
|
|
243
|
+
}
|
|
244
|
+
catch (err) {
|
|
245
|
+
console.error("[list_nodes]", err);
|
|
246
|
+
return errorResult(err instanceof Error ? err.message : String(err));
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
return server;
|
|
250
|
+
}
|
|
251
|
+
// ---------------------------------------------------------------------------
|
|
252
|
+
// Main — run when executed directly
|
|
253
|
+
// ---------------------------------------------------------------------------
|
|
254
|
+
async function main() {
|
|
255
|
+
const server = createServer();
|
|
256
|
+
const transport = new StdioServerTransport();
|
|
257
|
+
await server.connect(transport);
|
|
258
|
+
console.error("ChatGrid MCP server running on stdio");
|
|
259
|
+
}
|
|
260
|
+
main().catch((err) => {
|
|
261
|
+
console.error("Fatal error:", err);
|
|
262
|
+
process.exit(1);
|
|
263
|
+
});
|
|
264
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,8EAA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AE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5C,OAAO,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC;YACjD,CAAC,CAAC;iBACD,IAAI,CAAC,IAAI,CAAC,CAAC;YAEd,OAAO,UAAU,CAAC,SAAS,KAAK,CAAC,MAAM,gBAAgB,SAAS,EAAE,CAAC,CAAC;QACtE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;YACnC,OAAO,WAAW,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACvE,CAAC;IACH,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,8EAA8E;AAC9E,oCAAoC;AACpC,8EAA8E;AAE9E,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;AACxD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chatgrid-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for ChatGrid — give your AI assistant access to your team's project knowledge boards",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"chatgrid-mcp": "dist/bin/chatgrid-mcp.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/src/index.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"prepare": "npm run build",
|
|
16
|
+
"dev": "tsc --watch"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"mcp",
|
|
20
|
+
"chatgrid",
|
|
21
|
+
"ai",
|
|
22
|
+
"knowledge-base",
|
|
23
|
+
"claude"
|
|
24
|
+
],
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
28
|
+
"zod": "^3.25.23"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^22.15.0",
|
|
32
|
+
"typescript": "^5.8.3"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18"
|
|
36
|
+
}
|
|
37
|
+
}
|