@igor-olikh/openspec-mcp-server 1.1.0 → 1.2.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 +2 -1
- package/dist/server.js +38 -1
- package/openspec/changes/add-mcp-prompts/tasks.md +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@igor-olikh/openspec-mcp-server)
|
|
4
4
|
[](https://www.npmjs.com/package/@igor-olikh/openspec-mcp-server)
|
|
5
|
+
[](https://openspec.dev/)
|
|
5
6
|
|
|
6
|
-
Welcome! This is a simple bridge (plugin) that connects **[OpenSpec](https://
|
|
7
|
+
Welcome! This is a simple bridge (plugin) that connects **[OpenSpec](https://openspec.dev/)** to your favorite AI coding assistant (like **IBM Bob**, **Codex**, or **Claude Desktop**).
|
|
7
8
|
|
|
8
9
|
## What is this and why do I need it?
|
|
9
10
|
When you want your AI to build a new feature, you usually just type it into the chat. But as projects grow, the AI can forget things, get confused, or write messy code.
|
package/dist/server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
2
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
|
-
import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, McpError, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
import { getTools, handleToolCall } from './tools.js';
|
|
5
5
|
export class OpenSpecMCPServer {
|
|
6
6
|
server;
|
|
@@ -12,6 +12,7 @@ export class OpenSpecMCPServer {
|
|
|
12
12
|
}, {
|
|
13
13
|
capabilities: {
|
|
14
14
|
tools: {},
|
|
15
|
+
prompts: {},
|
|
15
16
|
},
|
|
16
17
|
});
|
|
17
18
|
this.setupHandlers();
|
|
@@ -23,6 +24,42 @@ export class OpenSpecMCPServer {
|
|
|
23
24
|
tools: getTools(),
|
|
24
25
|
};
|
|
25
26
|
});
|
|
27
|
+
this.server.setRequestHandler(ListPromptsRequestSchema, async () => {
|
|
28
|
+
return {
|
|
29
|
+
prompts: [
|
|
30
|
+
{
|
|
31
|
+
name: "openspec_kickoff",
|
|
32
|
+
description: "Initialize an AI coding session using Fission-AI OpenSpec best practices.",
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
38
|
+
if (request.params.name !== "openspec_kickoff") {
|
|
39
|
+
throw new McpError(ErrorCode.InvalidRequest, `Prompt not found: ${request.params.name}`);
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
description: "Initialize an AI coding session using Fission-AI OpenSpec best practices.",
|
|
43
|
+
messages: [
|
|
44
|
+
{
|
|
45
|
+
role: "user",
|
|
46
|
+
content: {
|
|
47
|
+
type: "text",
|
|
48
|
+
text: `You are an expert AI development assistant operating within a codebase managed by the Fission-AI OpenSpec framework.
|
|
49
|
+
Your workflow MUST be strictly spec-driven. Never write code until the specification is completely validated and active.
|
|
50
|
+
|
|
51
|
+
Follow this workflow exactly:
|
|
52
|
+
1. When asked to implement a feature, FIRST check if a change exists by using openspec tools (like \`openspec_status\` or \`openspec_list\`).
|
|
53
|
+
2. If there are no open specs for this feature, create one.
|
|
54
|
+
3. If an active change exists, use tools to read and validate the active specification.
|
|
55
|
+
4. If validation fails, DO NOT PROCEED TO CODE. Fix the spec first.
|
|
56
|
+
5. Once the design is validated and error-free, proceed to implement the feature by tackling the tasks sequentially.
|
|
57
|
+
6. Always communicate your plan clearly to the user.`
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
};
|
|
62
|
+
});
|
|
26
63
|
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
27
64
|
try {
|
|
28
65
|
const result = await handleToolCall(request.params.name, request.params.arguments || {}, this.projectPath);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Tasks
|
|
2
2
|
|
|
3
|
-
- [
|
|
4
|
-
- [
|
|
3
|
+
- [x] Implement `ListPromptsRequestSchema` in `src/server.ts`.
|
|
4
|
+
- [x] Implement `GetPromptRequestSchema` returning the massive text instruction string.
|
|
5
5
|
- [ ] Test in Codex UI using the Quick Action.
|
package/package.json
CHANGED