@oneentry/mcp-server 1.1.0 → 1.1.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.js CHANGED
@@ -80,6 +80,46 @@ for (const skill of SKILLS) {
80
80
  }
81
81
  }
82
82
  // ---------------------------------------------------------------------------
83
+ // Tools
84
+ // ---------------------------------------------------------------------------
85
+ server.registerTool("load-context", {
86
+ description: "IMPORTANT: Call this tool automatically at the start of EVERY session when working on a project that uses OneEntry CMS or OneEntry SDK. " +
87
+ "This loads the full OneEntry SDK instructions, rules, and anti-hallucination guidelines into the context. " +
88
+ "Do not skip this — without it you will make mistakes working with OneEntry API.",
89
+ inputSchema: {},
90
+ }, async () => {
91
+ const text = await fetchContent(CLAUDE_MD_PATH);
92
+ return { content: [{ type: "text", text }] };
93
+ });
94
+ server.registerTool("get-rule", {
95
+ description: "Fetch the content of a specific OneEntry SDK rule by name",
96
+ inputSchema: { name: z.string().describe(`Rule name. Available: ${RULES.map((r) => r.name).join(", ")}`) },
97
+ }, async ({ name }) => {
98
+ const rule = RULES.find((r) => r.name === name);
99
+ if (!rule) {
100
+ return { content: [{ type: "text", text: `Unknown rule: ${name}. Available: ${RULES.map((r) => r.name).join(", ")}` }], isError: true };
101
+ }
102
+ const text = await fetchContent(rule.path);
103
+ return { content: [{ type: "text", text }] };
104
+ });
105
+ server.registerTool("get-skill", {
106
+ description: "Fetch the content of a specific OneEntry skill/slash-command by name",
107
+ inputSchema: {
108
+ name: z.string().describe(`Skill name. Available: ${SKILLS.map((s) => s.name).join(", ")}`),
109
+ arguments: z.string().optional().describe("Optional arguments passed to the skill (replaces $ARGUMENTS placeholder)"),
110
+ },
111
+ }, async (args) => {
112
+ const skill = SKILLS.find((s) => s.name === args.name);
113
+ if (!skill) {
114
+ return { content: [{ type: "text", text: `Unknown skill: ${args.name}. Available: ${SKILLS.map((s) => s.name).join(", ")}` }], isError: true };
115
+ }
116
+ let text = await fetchContent(skill.path);
117
+ if (args.arguments) {
118
+ text = text.replace(/\$ARGUMENTS/g, args.arguments);
119
+ }
120
+ return { content: [{ type: "text", text }] };
121
+ });
122
+ // ---------------------------------------------------------------------------
83
123
  // Start
84
124
  // ---------------------------------------------------------------------------
85
125
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneentry/mcp-server",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "MCP server for OneEntry SDK — rules and skills for Claude Code",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -111,6 +111,63 @@ for (const skill of SKILLS) {
111
111
  }
112
112
  }
113
113
 
114
+ // ---------------------------------------------------------------------------
115
+ // Tools
116
+ // ---------------------------------------------------------------------------
117
+
118
+ server.registerTool(
119
+ "load-context",
120
+ {
121
+ description:
122
+ "IMPORTANT: Call this tool automatically at the start of EVERY session when working on a project that uses OneEntry CMS or OneEntry SDK. " +
123
+ "This loads the full OneEntry SDK instructions, rules, and anti-hallucination guidelines into the context. " +
124
+ "Do not skip this — without it you will make mistakes working with OneEntry API.",
125
+ inputSchema: {},
126
+ },
127
+ async () => {
128
+ const text = await fetchContent(CLAUDE_MD_PATH);
129
+ return { content: [{ type: "text" as const, text }] };
130
+ }
131
+ );
132
+
133
+ server.registerTool(
134
+ "get-rule",
135
+ {
136
+ description: "Fetch the content of a specific OneEntry SDK rule by name",
137
+ inputSchema: { name: z.string().describe(`Rule name. Available: ${RULES.map((r) => r.name).join(", ")}`) },
138
+ },
139
+ async ({ name }) => {
140
+ const rule = RULES.find((r) => r.name === name);
141
+ if (!rule) {
142
+ return { content: [{ type: "text" as const, text: `Unknown rule: ${name}. Available: ${RULES.map((r) => r.name).join(", ")}` }], isError: true };
143
+ }
144
+ const text = await fetchContent(rule.path);
145
+ return { content: [{ type: "text" as const, text }] };
146
+ }
147
+ );
148
+
149
+ server.registerTool(
150
+ "get-skill",
151
+ {
152
+ description: "Fetch the content of a specific OneEntry skill/slash-command by name",
153
+ inputSchema: {
154
+ name: z.string().describe(`Skill name. Available: ${SKILLS.map((s) => s.name).join(", ")}`),
155
+ arguments: z.string().optional().describe("Optional arguments passed to the skill (replaces $ARGUMENTS placeholder)"),
156
+ },
157
+ },
158
+ async (args) => {
159
+ const skill = SKILLS.find((s) => s.name === args.name);
160
+ if (!skill) {
161
+ return { content: [{ type: "text" as const, text: `Unknown skill: ${args.name}. Available: ${SKILLS.map((s) => s.name).join(", ")}` }], isError: true };
162
+ }
163
+ let text = await fetchContent(skill.path);
164
+ if (args.arguments) {
165
+ text = text.replace(/\$ARGUMENTS/g, args.arguments);
166
+ }
167
+ return { content: [{ type: "text" as const, text }] };
168
+ }
169
+ );
170
+
114
171
  // ---------------------------------------------------------------------------
115
172
  // Start
116
173
  // ---------------------------------------------------------------------------