@aibuilders/mcp-coach-server 1.0.0 → 1.0.2
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/dist/index.d.ts +1 -0
- package/dist/index.js +6 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
@@ -121,6 +122,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
124
|
catch { }
|
|
125
|
+
// For OpenAI SDK, baseURL should include /v1 since SDK appends paths directly
|
|
126
|
+
const sdkBaseUrl = baseUrl.endsWith('/v1') ? baseUrl : `${baseUrl}/v1`;
|
|
124
127
|
return {
|
|
125
128
|
content: [
|
|
126
129
|
{
|
|
@@ -142,12 +145,12 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
142
145
|
recommendation: "We strongly recommend using the OpenAI SDK to interact with this API. It provides a clean, well-documented interface and handles authentication automatically.",
|
|
143
146
|
usage_note: "You can use OpenAI-compatible SDKs against this API. The OpenAI SDK is the recommended approach.",
|
|
144
147
|
example_node: {
|
|
145
|
-
baseURL:
|
|
148
|
+
baseURL: sdkBaseUrl,
|
|
146
149
|
endpoint: "/v1/chat/completions",
|
|
147
|
-
code_example: `import OpenAI from 'openai';\n\nconst openai = new OpenAI({\n baseURL: '${
|
|
150
|
+
code_example: `import OpenAI from 'openai';\n\nconst openai = new OpenAI({\n baseURL: '${sdkBaseUrl}',\n apiKey: process.env.AI_BUILDER_TOKEN,\n});\n\nconst completion = await openai.chat.completions.create({\n model: 'grok-4-fast',\n messages: [{ role: 'user', content: 'Hello!' }],\n});`
|
|
148
151
|
},
|
|
149
152
|
example_python: {
|
|
150
|
-
code_example: `from openai import OpenAI\nimport os\n\nclient = OpenAI(\n base_url='${
|
|
153
|
+
code_example: `from openai import OpenAI\nimport os\n\nclient = OpenAI(\n base_url='${sdkBaseUrl}',\n api_key=os.getenv('AI_BUILDER_TOKEN')\n)\n\ncompletion = client.chat.completions.create(\n model='grok-4-fast',\n messages=[{'role': 'user', 'content': 'Hello!'}]\n)`
|
|
151
154
|
}
|
|
152
155
|
},
|
|
153
156
|
mcp_recommendation: {
|