counsel-mcp-server 0.1.3 → 0.1.6
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 +65 -11
- package/package.json +16 -9
- package/dist/client.d.ts +0 -7
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -29
- package/dist/client.js.map +0 -1
- package/dist/config.d.ts +0 -4
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -12
- package/dist/config.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -129
- package/dist/index.js.map +0 -1
- package/dist/tools/advisor.d.ts +0 -19
- package/dist/tools/advisor.d.ts.map +0 -1
- package/dist/tools/advisor.js +0 -23
- package/dist/tools/advisor.js.map +0 -1
- package/dist/tools/debates.d.ts +0 -87
- package/dist/tools/debates.d.ts.map +0 -1
- package/dist/tools/debates.js +0 -101
- package/dist/tools/debates.js.map +0 -1
package/README.md
CHANGED
|
@@ -8,16 +8,18 @@ An open-source [Model Context Protocol (MCP)](https://modelcontextprotocol.io) s
|
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
|
+
- **Hosted & Self-Hosted** - Use the hosted server instantly or run your own instance
|
|
11
12
|
- **Strategic Reasoning** - Access Counsel's debate and multi-perspective reasoning engines
|
|
12
13
|
- **Advisor Sessions** - Run interactive intake and profile tuning sessions
|
|
13
14
|
- **Native OAuth 2.0** - Standard MCP authentication handled automatically by clients
|
|
14
|
-
- **
|
|
15
|
+
- **Dual Transport** - STDIO for local clients, HTTP for web clients and shared servers
|
|
15
16
|
|
|
16
17
|
---
|
|
17
18
|
|
|
18
19
|
## Table of Contents
|
|
19
20
|
|
|
20
|
-
- [
|
|
21
|
+
- [Quick Start (Hosted)](#quick-start-hosted)
|
|
22
|
+
- [Installation (Self-Hosted)](#installation-self-hosted)
|
|
21
23
|
- [Claude Desktop](#claude-desktop)
|
|
22
24
|
- [Claude Code (CLI)](#claude-code-cli)
|
|
23
25
|
- [Cursor](#cursor)
|
|
@@ -35,7 +37,34 @@ An open-source [Model Context Protocol (MCP)](https://modelcontextprotocol.io) s
|
|
|
35
37
|
|
|
36
38
|
---
|
|
37
39
|
|
|
38
|
-
##
|
|
40
|
+
## Quick Start (Hosted)
|
|
41
|
+
|
|
42
|
+
Connect instantly to the hosted Counsel MCP server - no installation required:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
http://counsel-mcp.getmason.dev/mcp
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For MCP clients that support HTTP transport, simply add:
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"counsel": {
|
|
54
|
+
"url": "http://counsel-mcp.getmason.dev/mcp",
|
|
55
|
+
"transport": "http"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
OAuth authentication is handled automatically by your MCP client.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Installation (Self-Hosted)
|
|
66
|
+
|
|
67
|
+
Run your own instance of the Counsel MCP server locally.
|
|
39
68
|
|
|
40
69
|
### Prerequisites
|
|
41
70
|
|
|
@@ -144,17 +173,32 @@ Add to your VS Code settings (`settings.json`):
|
|
|
144
173
|
|
|
145
174
|
### Other MCP Clients
|
|
146
175
|
|
|
147
|
-
|
|
176
|
+
The server supports two transport modes. Choose based on your client's capabilities:
|
|
148
177
|
|
|
149
|
-
|
|
150
|
-
- **Args**: `["-y", "counsel-mcp-server", "start"]`
|
|
151
|
-
- **Transport**: `stdio` (default) or `http` at `http://localhost:3000/mcp`
|
|
178
|
+
#### STDIO Mode (Default)
|
|
152
179
|
|
|
153
|
-
|
|
180
|
+
Most MCP clients use STDIO transport. Configure with:
|
|
154
181
|
|
|
155
|
-
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"mcpServers": {
|
|
185
|
+
"counsel": {
|
|
186
|
+
"command": "npx",
|
|
187
|
+
"args": ["-y", "counsel-mcp-server", "start"],
|
|
188
|
+
"env": {
|
|
189
|
+
"COUNSEL_API_KEY": "your_api_key_here"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
#### HTTP Mode with OAuth
|
|
197
|
+
|
|
198
|
+
For clients that support HTTP transport with OAuth 2.0, run the server separately:
|
|
156
199
|
|
|
157
200
|
```bash
|
|
201
|
+
# Start the HTTP server
|
|
158
202
|
npx -y counsel-mcp-server http --port 3000
|
|
159
203
|
```
|
|
160
204
|
|
|
@@ -162,7 +206,8 @@ This starts an HTTP server with:
|
|
|
162
206
|
- **MCP endpoint**: `http://localhost:3000/mcp`
|
|
163
207
|
- **OAuth discovery**: `http://localhost:3000/.well-known/oauth-authorization-server`
|
|
164
208
|
|
|
165
|
-
Then configure your client
|
|
209
|
+
Then configure your client to connect:
|
|
210
|
+
|
|
166
211
|
```json
|
|
167
212
|
{
|
|
168
213
|
"mcpServers": {
|
|
@@ -174,7 +219,16 @@ Then configure your client with:
|
|
|
174
219
|
}
|
|
175
220
|
```
|
|
176
221
|
|
|
177
|
-
|
|
222
|
+
HTTP mode uses OAuth 2.0 with automatic token management - no API key required.
|
|
223
|
+
|
|
224
|
+
#### Transport Comparison
|
|
225
|
+
|
|
226
|
+
| Feature | STDIO Mode | HTTP Mode |
|
|
227
|
+
|---------|------------|-----------|
|
|
228
|
+
| **Command** | `npx -y counsel-mcp-server start` | `npx -y counsel-mcp-server http` |
|
|
229
|
+
| **Auth** | API key via env var | OAuth 2.0 (automatic) |
|
|
230
|
+
| **Setup** | Single config | Run server + configure client |
|
|
231
|
+
| **Best for** | Claude Desktop, Cursor, VS Code | Web clients, shared servers |
|
|
178
232
|
|
|
179
233
|
---
|
|
180
234
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "counsel-mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Open-source MCP server for connecting AI agents to the Counsel API",
|
|
5
5
|
"author": "Counsel AI",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"
|
|
7
|
+
"module": "src/index.ts",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
10
|
"bin": {
|
|
11
|
-
"counsel-mcp": "dist/
|
|
11
|
+
"counsel-mcp": "dist/cli.js"
|
|
12
12
|
},
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"LICENSE"
|
|
23
23
|
],
|
|
24
24
|
"engines": {
|
|
25
|
-
"node": ">=
|
|
25
|
+
"node": ">=20.0.0"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
-
"build": "
|
|
29
|
-
"
|
|
30
|
-
"
|
|
28
|
+
"build": "npx smithery build -t stdio",
|
|
29
|
+
"dev": "npx smithery dev",
|
|
30
|
+
"start": "node dist/index.js",
|
|
31
|
+
"lint": "eslint src --ext .ts",
|
|
31
32
|
"test": "vitest run",
|
|
32
33
|
"test:watch": "vitest",
|
|
33
|
-
"lint": "tsc --noEmit",
|
|
34
34
|
"security:check": "node scripts/check-secrets.js",
|
|
35
35
|
"security:check:all": "node scripts/check-secrets.js --all",
|
|
36
36
|
"prepublishOnly": "npm run build && npm run test",
|
|
@@ -65,17 +65,24 @@
|
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@hono/node-server": "^1.19.7",
|
|
67
67
|
"@modelcontextprotocol/sdk": "^1.0.1",
|
|
68
|
+
"@smithery/sdk": "^4.0.1",
|
|
68
69
|
"axios": "^1.6.0",
|
|
69
70
|
"commander": "^11.1.0",
|
|
70
71
|
"dotenv": "^16.3.1",
|
|
71
72
|
"express": "^5.2.1",
|
|
72
|
-
"zod": "^3.
|
|
73
|
+
"zod": "^4.3.5"
|
|
73
74
|
},
|
|
74
75
|
"devDependencies": {
|
|
76
|
+
"@eslint/js": "^9.39.2",
|
|
77
|
+
"@smithery/cli": "^3.0.3",
|
|
75
78
|
"@types/express": "^5.0.6",
|
|
76
79
|
"@types/node": "^20.0.0",
|
|
80
|
+
"@typescript-eslint/eslint-plugin": "^8.52.0",
|
|
81
|
+
"@typescript-eslint/parser": "^8.52.0",
|
|
82
|
+
"eslint": "^9.39.2",
|
|
77
83
|
"husky": "^9.1.7",
|
|
78
84
|
"typescript": "^5.0.0",
|
|
85
|
+
"typescript-eslint": "^8.52.0",
|
|
79
86
|
"vitest": "^2.0.0"
|
|
80
87
|
}
|
|
81
88
|
}
|
package/dist/client.d.ts
DELETED
package/dist/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAU7C;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,aAOtB,CAAC"}
|
package/dist/client.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
import { config } from './config.js';
|
|
3
|
-
/**
|
|
4
|
-
* Get API key from environment variable
|
|
5
|
-
*/
|
|
6
|
-
function getApiKey() {
|
|
7
|
-
return process.env.COUNSEL_API_KEY;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Pre-configured Axios client for Counsel API calls.
|
|
11
|
-
* Uses COUNSEL_API_KEY environment variable for authentication.
|
|
12
|
-
*/
|
|
13
|
-
export const apiClient = axios.create({
|
|
14
|
-
baseURL: config.COUNSEL_API_URL,
|
|
15
|
-
timeout: 60000,
|
|
16
|
-
headers: {
|
|
17
|
-
'Content-Type': 'application/json',
|
|
18
|
-
'User-Agent': 'counsel-mcp-server/0.1.0'
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
// Add request interceptor to inject the auth token
|
|
22
|
-
apiClient.interceptors.request.use(async (reqConfig) => {
|
|
23
|
-
const apiKey = getApiKey();
|
|
24
|
-
if (apiKey) {
|
|
25
|
-
reqConfig.headers.Authorization = `Bearer ${apiKey}`;
|
|
26
|
-
}
|
|
27
|
-
return reqConfig;
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,SAAS,SAAS;IAChB,OAAO,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAkB,KAAK,CAAC,MAAM,CAAC;IACnD,OAAO,EAAE,MAAM,CAAC,eAAe;IAC/B,OAAO,EAAE,KAAK;IACd,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;QAClC,YAAY,EAAE,0BAA0B;KACzC;CACF,CAAC,CAAC;AAEH,mDAAmD;AACnD,SAAS,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;IACrD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAI,MAAM,EAAE,CAAC;QACX,SAAS,CAAC,OAAO,CAAC,aAAa,GAAG,UAAU,MAAM,EAAE,CAAC;IACvD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC,CAAC"}
|
package/dist/config.d.ts
DELETED
package/dist/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,MAAM;;CAAkC,CAAC"}
|
package/dist/config.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import dotenv from 'dotenv';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import { fileURLToPath } from 'url';
|
|
5
|
-
// Load .env from project root if it exists (mostly for dev)
|
|
6
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
-
dotenv.config({ path: path.resolve(__dirname, '../../.env') });
|
|
8
|
-
const ConfigSchema = z.object({
|
|
9
|
-
COUNSEL_API_URL: z.string().default('https://counsel.getmason.dev'),
|
|
10
|
-
});
|
|
11
|
-
export const config = ConfigSchema.parse(process.env);
|
|
12
|
-
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,4DAA4D;AAC5D,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;AAE/D,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,8BAA8B,CAAC;CACpE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC"}
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
-
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
5
|
-
import { Command } from "commander";
|
|
6
|
-
import { randomUUID } from "crypto";
|
|
7
|
-
import { config } from "./config.js";
|
|
8
|
-
import { TOOLS as DEBATE_TOOLS } from "./tools/debates.js";
|
|
9
|
-
import { TOOLS as ADVISOR_TOOLS } from "./tools/advisor.js";
|
|
10
|
-
const program = new Command();
|
|
11
|
-
program
|
|
12
|
-
.name("counsel-mcp")
|
|
13
|
-
.description("Counsel MCP Server")
|
|
14
|
-
.version("0.1.3");
|
|
15
|
-
/**
|
|
16
|
-
* Create and configure the MCP server with all tools
|
|
17
|
-
*/
|
|
18
|
-
function createMcpServer() {
|
|
19
|
-
const server = new McpServer({
|
|
20
|
-
name: "counsel-mcp",
|
|
21
|
-
version: "0.1.3",
|
|
22
|
-
});
|
|
23
|
-
// Register all tools
|
|
24
|
-
for (const tool of Object.values(DEBATE_TOOLS)) {
|
|
25
|
-
server.tool(tool.name, tool.schema, tool.handler);
|
|
26
|
-
}
|
|
27
|
-
for (const tool of Object.values(ADVISOR_TOOLS)) {
|
|
28
|
-
server.tool(tool.name, tool.schema, tool.handler);
|
|
29
|
-
}
|
|
30
|
-
return server;
|
|
31
|
-
}
|
|
32
|
-
// STDIO mode (default) - for Claude Desktop, Cursor, MCPJam, etc.
|
|
33
|
-
program.command("start")
|
|
34
|
-
.description("Start the MCP server in stdio mode (default)")
|
|
35
|
-
.action(async () => {
|
|
36
|
-
const server = createMcpServer();
|
|
37
|
-
const transport = new StdioServerTransport();
|
|
38
|
-
await server.connect(transport);
|
|
39
|
-
console.error(`Counsel MCP Server started (stdio mode)`);
|
|
40
|
-
console.error(`Upstream API: ${config.COUNSEL_API_URL}`);
|
|
41
|
-
console.error(`Auth: Set COUNSEL_API_KEY environment variable`);
|
|
42
|
-
});
|
|
43
|
-
// HTTP mode - for clients that support OAuth
|
|
44
|
-
program.command("http")
|
|
45
|
-
.description("Start the MCP server in HTTP mode with OAuth support")
|
|
46
|
-
.option("-p, --port <port>", "Port to listen on", "3000")
|
|
47
|
-
.option("--host <host>", "Host to bind to", "localhost")
|
|
48
|
-
.action(async (options) => {
|
|
49
|
-
const express = (await import("express")).default;
|
|
50
|
-
const { ProxyOAuthServerProvider } = await import("@modelcontextprotocol/sdk/server/auth/providers/proxyProvider.js");
|
|
51
|
-
const { mcpAuthRouter } = await import("@modelcontextprotocol/sdk/server/auth/router.js");
|
|
52
|
-
const { requireBearerAuth } = await import("@modelcontextprotocol/sdk/server/auth/middleware/bearerAuth.js");
|
|
53
|
-
const port = parseInt(options.port, 10);
|
|
54
|
-
const host = options.host;
|
|
55
|
-
const baseUrl = new URL(`http://${host}:${port}`);
|
|
56
|
-
const counselApiUrl = config.COUNSEL_API_URL;
|
|
57
|
-
// Create OAuth provider that proxies to Counsel API
|
|
58
|
-
const oauthProvider = new ProxyOAuthServerProvider({
|
|
59
|
-
endpoints: {
|
|
60
|
-
authorizationUrl: `${counselApiUrl}/oauth/authorize`,
|
|
61
|
-
tokenUrl: `${counselApiUrl}/oauth/token`,
|
|
62
|
-
registrationUrl: `${counselApiUrl}/oauth/register`,
|
|
63
|
-
},
|
|
64
|
-
verifyAccessToken: async (token) => {
|
|
65
|
-
return {
|
|
66
|
-
token,
|
|
67
|
-
clientId: "counsel-mcp-client",
|
|
68
|
-
scopes: ["counsel:read", "counsel:write"],
|
|
69
|
-
expiresAt: Math.floor(Date.now() / 1000) + 3600,
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
getClient: async (clientId) => {
|
|
73
|
-
return {
|
|
74
|
-
client_id: clientId,
|
|
75
|
-
redirect_uris: [],
|
|
76
|
-
grant_types: ["authorization_code", "refresh_token"],
|
|
77
|
-
response_types: ["code"],
|
|
78
|
-
token_endpoint_auth_method: "client_secret_post",
|
|
79
|
-
};
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
|
-
const app = express();
|
|
83
|
-
app.use(express.json());
|
|
84
|
-
// OAuth routes
|
|
85
|
-
app.use(mcpAuthRouter({
|
|
86
|
-
provider: oauthProvider,
|
|
87
|
-
issuerUrl: baseUrl,
|
|
88
|
-
baseUrl: baseUrl,
|
|
89
|
-
scopesSupported: ["counsel:read", "counsel:write"],
|
|
90
|
-
serviceDocumentationUrl: new URL("https://counsel.getmason.dev/docs"),
|
|
91
|
-
}));
|
|
92
|
-
const mcpServer = createMcpServer();
|
|
93
|
-
const transports = new Map();
|
|
94
|
-
// Protected MCP endpoint
|
|
95
|
-
const mcpHandler = express.Router();
|
|
96
|
-
mcpHandler.use(requireBearerAuth({
|
|
97
|
-
verifier: oauthProvider,
|
|
98
|
-
requiredScopes: ["counsel:read"],
|
|
99
|
-
}));
|
|
100
|
-
mcpHandler.all("/", async (req, res) => {
|
|
101
|
-
const sessionId = req.headers["mcp-session-id"] || randomUUID();
|
|
102
|
-
let transport = transports.get(sessionId);
|
|
103
|
-
if (!transport) {
|
|
104
|
-
transport = new StreamableHTTPServerTransport({
|
|
105
|
-
sessionIdGenerator: () => sessionId,
|
|
106
|
-
});
|
|
107
|
-
transports.set(sessionId, transport);
|
|
108
|
-
await mcpServer.connect(transport);
|
|
109
|
-
transport.onclose = () => transports.delete(sessionId);
|
|
110
|
-
}
|
|
111
|
-
await transport.handleRequest(req, res);
|
|
112
|
-
});
|
|
113
|
-
app.use("/mcp", mcpHandler);
|
|
114
|
-
app.get("/health", (_req, res) => {
|
|
115
|
-
res.json({ status: "ok", version: "0.1.3" });
|
|
116
|
-
});
|
|
117
|
-
app.listen(port, host, () => {
|
|
118
|
-
console.log(`Counsel MCP Server running at ${baseUrl.href}`);
|
|
119
|
-
console.log(`MCP endpoint: ${baseUrl.href}mcp`);
|
|
120
|
-
console.log(`OAuth metadata: ${baseUrl.href}.well-known/oauth-authorization-server`);
|
|
121
|
-
console.log(`\nUpstream API: ${counselApiUrl}`);
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
// Default to stdio mode
|
|
125
|
-
if (process.argv.length === 2) {
|
|
126
|
-
process.argv.push("start");
|
|
127
|
-
}
|
|
128
|
-
program.parse(process.argv);
|
|
129
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,aAAa,CAAC;KACnB,WAAW,CAAC,oBAAoB,CAAC;KACjC,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB;;GAEG;AACH,SAAS,eAAe;IACtB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,aAAa;QACnB,O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{
|
|
7
|
-
question: z.ZodString;
|
|
8
|
-
};
|
|
9
|
-
handler: (args: {
|
|
10
|
-
question: string;
|
|
11
|
-
}) => Promise<{
|
|
12
|
-
content: {
|
|
13
|
-
type: "text";
|
|
14
|
-
text: string;
|
|
15
|
-
}[];
|
|
16
|
-
}>;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=advisor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"advisor.d.ts","sourceRoot":"","sources":["../../src/tools/advisor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,KAAK;;;;;;;wBAOQ;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE;;;;;;;CAa7C,CAAC"}
|
package/dist/tools/advisor.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { apiClient } from "../client.js";
|
|
3
|
-
export const TOOLS = {
|
|
4
|
-
consult_advisor: {
|
|
5
|
-
name: "consult_advisor",
|
|
6
|
-
description: "Start an interactive advisor session to brainstorm or scope a problem.",
|
|
7
|
-
schema: {
|
|
8
|
-
question: z.string().describe("The initial topic or question."),
|
|
9
|
-
},
|
|
10
|
-
handler: async (args) => {
|
|
11
|
-
const response = await apiClient.post("/advisor/start", { question: args.question });
|
|
12
|
-
return {
|
|
13
|
-
content: [{
|
|
14
|
-
type: "text",
|
|
15
|
-
text: `Advisor session started.\nSession ID: ${response.data.session_id}\n\nAdvisor: ${response.data.initial_message}`
|
|
16
|
-
}]
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
// Potential future tool: respond_to_advisor (for multi-turn via tool)
|
|
21
|
-
// For now, simple start is enough as per spec.
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=advisor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"advisor.js","sourceRoot":"","sources":["../../src/tools/advisor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,eAAe,EAAE;QACf,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,wEAAwE;QACrF,MAAM,EAAE;YACN,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;SAChE;QACD,OAAO,EAAE,KAAK,EAAE,IAA0B,EAAE,EAAE;YAC5C,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YACrF,OAAO;gBACL,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,yCAAyC,QAAQ,CAAC,IAAI,CAAC,UAAU,gBAAgB,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE;qBACvH,CAAC;aACH,CAAC;QACJ,CAAC;KACF;IAED,sEAAsE;IACtE,+CAA+C;CAChD,CAAC"}
|
package/dist/tools/debates.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const TOOLS: {
|
|
3
|
-
start_consultation: {
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
schema: {
|
|
7
|
-
question: z.ZodString;
|
|
8
|
-
context: z.ZodOptional<z.ZodString>;
|
|
9
|
-
mode: z.ZodDefault<z.ZodEnum<["quick", "standard", "deep"]>>;
|
|
10
|
-
stakeholders: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
11
|
-
};
|
|
12
|
-
handler: (args: {
|
|
13
|
-
question: string;
|
|
14
|
-
context?: string;
|
|
15
|
-
mode?: string;
|
|
16
|
-
stakeholders?: string[];
|
|
17
|
-
}) => Promise<{
|
|
18
|
-
content: {
|
|
19
|
-
type: "text";
|
|
20
|
-
text: string;
|
|
21
|
-
}[];
|
|
22
|
-
}>;
|
|
23
|
-
};
|
|
24
|
-
get_consultation_status: {
|
|
25
|
-
name: string;
|
|
26
|
-
description: string;
|
|
27
|
-
schema: {
|
|
28
|
-
debate_id: z.ZodString;
|
|
29
|
-
};
|
|
30
|
-
handler: (args: {
|
|
31
|
-
debate_id: string;
|
|
32
|
-
}) => Promise<{
|
|
33
|
-
content: {
|
|
34
|
-
type: "text";
|
|
35
|
-
text: string;
|
|
36
|
-
}[];
|
|
37
|
-
}>;
|
|
38
|
-
};
|
|
39
|
-
get_consultation_report: {
|
|
40
|
-
name: string;
|
|
41
|
-
description: string;
|
|
42
|
-
schema: {
|
|
43
|
-
debate_id: z.ZodString;
|
|
44
|
-
};
|
|
45
|
-
handler: (args: {
|
|
46
|
-
debate_id: string;
|
|
47
|
-
}) => Promise<{
|
|
48
|
-
content: {
|
|
49
|
-
type: "text";
|
|
50
|
-
text: any;
|
|
51
|
-
}[];
|
|
52
|
-
}>;
|
|
53
|
-
};
|
|
54
|
-
list_consultations: {
|
|
55
|
-
name: string;
|
|
56
|
-
description: string;
|
|
57
|
-
schema: {
|
|
58
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
59
|
-
};
|
|
60
|
-
handler: (args: {
|
|
61
|
-
limit: number;
|
|
62
|
-
}) => Promise<{
|
|
63
|
-
content: {
|
|
64
|
-
type: "text";
|
|
65
|
-
text: any;
|
|
66
|
-
}[];
|
|
67
|
-
}>;
|
|
68
|
-
};
|
|
69
|
-
sharpen_question: {
|
|
70
|
-
name: string;
|
|
71
|
-
description: string;
|
|
72
|
-
schema: {
|
|
73
|
-
question: z.ZodString;
|
|
74
|
-
context: z.ZodOptional<z.ZodString>;
|
|
75
|
-
};
|
|
76
|
-
handler: (args: {
|
|
77
|
-
question: string;
|
|
78
|
-
context?: string;
|
|
79
|
-
}) => Promise<{
|
|
80
|
-
content: {
|
|
81
|
-
type: "text";
|
|
82
|
-
text: any;
|
|
83
|
-
}[];
|
|
84
|
-
}>;
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
//# sourceMappingURL=debates.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debates.d.ts","sourceRoot":"","sources":["../../src/tools/debates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,KAAK;;;;;;;;;;wBAUQ;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;SAAE;;;;;;;;;;;;;wBAsB9E;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;wBAiBrB;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;wBA0BrB;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;wBAiBjB;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE;;;;;;;CAO/D,CAAC"}
|
package/dist/tools/debates.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { apiClient } from "../client.js";
|
|
3
|
-
// Tool Definitions
|
|
4
|
-
export const TOOLS = {
|
|
5
|
-
start_consultation: {
|
|
6
|
-
name: "start_consultation",
|
|
7
|
-
description: "Start a new strategic consultation (debate) to analyze a complex question.",
|
|
8
|
-
schema: {
|
|
9
|
-
question: z.string().describe("The core question to verify or analyze."),
|
|
10
|
-
context: z.string().optional().describe("Additional context about the situation."),
|
|
11
|
-
mode: z.enum(["quick", "standard", "deep"]).default("standard").describe("Depth of analysis."),
|
|
12
|
-
stakeholders: z.array(z.string()).optional().describe("Key stakeholders to consider."),
|
|
13
|
-
},
|
|
14
|
-
handler: async (args) => {
|
|
15
|
-
const response = await apiClient.post("/debates", {
|
|
16
|
-
question: args.question,
|
|
17
|
-
context: args.context,
|
|
18
|
-
config: { mode: args.mode }, // Assuming API expects config object
|
|
19
|
-
stakeholders: args.stakeholders
|
|
20
|
-
});
|
|
21
|
-
return {
|
|
22
|
-
content: [{
|
|
23
|
-
type: "text",
|
|
24
|
-
text: `Consultation started successfully.\nID: ${response.data.id}\nStatus: ${response.data.status}`
|
|
25
|
-
}]
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
get_consultation_status: {
|
|
30
|
-
name: "get_consultation_status",
|
|
31
|
-
description: "Check the status of an ongoing consultation.",
|
|
32
|
-
schema: {
|
|
33
|
-
debate_id: z.string().describe("The ID of the consultation to check."),
|
|
34
|
-
},
|
|
35
|
-
handler: async (args) => {
|
|
36
|
-
const response = await apiClient.get(`/debates/${args.debate_id}`);
|
|
37
|
-
return {
|
|
38
|
-
content: [{
|
|
39
|
-
type: "text",
|
|
40
|
-
text: JSON.stringify(response.data, null, 2)
|
|
41
|
-
}]
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
get_consultation_report: {
|
|
46
|
-
name: "get_consultation_report",
|
|
47
|
-
description: "Retrieve the final synthesis report of a completed consultation.",
|
|
48
|
-
schema: {
|
|
49
|
-
debate_id: z.string().describe("The ID of the consultation."),
|
|
50
|
-
},
|
|
51
|
-
handler: async (args) => {
|
|
52
|
-
try {
|
|
53
|
-
const response = await apiClient.get(`/debates/${args.debate_id}/synthesis`);
|
|
54
|
-
return {
|
|
55
|
-
content: [{
|
|
56
|
-
type: "text",
|
|
57
|
-
text: response.data.markdown || response.data.content || JSON.stringify(response.data)
|
|
58
|
-
}]
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
catch (err) {
|
|
62
|
-
if (err.response?.status === 404) {
|
|
63
|
-
return {
|
|
64
|
-
content: [{ type: "text", text: "Report not ready or not found." }]
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
throw err;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
list_consultations: {
|
|
72
|
-
name: "list_consultations",
|
|
73
|
-
description: "List past consultations.",
|
|
74
|
-
schema: {
|
|
75
|
-
limit: z.number().optional().default(10),
|
|
76
|
-
},
|
|
77
|
-
handler: async (args) => {
|
|
78
|
-
const response = await apiClient.get("/debates", { params: { limit: args.limit } });
|
|
79
|
-
const debates = response.data.items || response.data;
|
|
80
|
-
const summary = debates.map((d) => `- [${d.id}] ${d.question} (${d.status})`).join("\n");
|
|
81
|
-
return {
|
|
82
|
-
content: [{ type: "text", text: summary }]
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
sharpen_question: {
|
|
87
|
-
name: "sharpen_question",
|
|
88
|
-
description: "Refine a strategic question using the enhancement engine.",
|
|
89
|
-
schema: {
|
|
90
|
-
question: z.string(),
|
|
91
|
-
context: z.string().optional()
|
|
92
|
-
},
|
|
93
|
-
handler: async (args) => {
|
|
94
|
-
const response = await apiClient.post("/enhance/question", args);
|
|
95
|
-
return {
|
|
96
|
-
content: [{ type: "text", text: response.data.enhanced_question || response.data.result }]
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
//# sourceMappingURL=debates.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debates.js","sourceRoot":"","sources":["../../src/tools/debates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,mBAAmB;AACnB,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,kBAAkB,EAAE;QAClB,IAAI,EAAE,oBAAoB;QAC1B,WA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