@cachly-dev/mcp-server 0.10.83 → 0.10.84

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.
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Agent-framework tool-spec exporter.
3
+ *
4
+ * cachly exposes 114 MCP tools. MCP-native clients (Claude Code, Cursor,
5
+ * Windsurf, Copilot) speak MCP directly. But the wider agent ecosystem —
6
+ * OpenAI Assistants / function calling, the Anthropic Messages API, LangChain,
7
+ * CrewAI, AutoGen — each want the SAME tool definitions in their own dialect.
8
+ *
9
+ * Rather than hand-maintain four copies, we derive every dialect from the single
10
+ * TOOLS source of truth. Zero new runtime dependencies: these are just shape
11
+ * transforms over the JSON-Schema input schemas the tools already declare.
12
+ *
13
+ * CLI: npx @cachly-dev/mcp-server tool-specs --format=openapi|openai|anthropic|langchain
14
+ */
15
+ export type ToolDef = {
16
+ name: string;
17
+ description: string;
18
+ inputSchema: {
19
+ type: string;
20
+ properties?: Record<string, unknown>;
21
+ required?: string[];
22
+ };
23
+ };
24
+ export type SpecFormat = 'openapi' | 'openai' | 'anthropic' | 'langchain';
25
+ /** OpenAI function-calling / Assistants tool array. */
26
+ export declare function toOpenAITools(tools: ReadonlyArray<ToolDef>): unknown[];
27
+ /** Anthropic Messages API tool array (input_schema, not parameters). */
28
+ export declare function toAnthropicTools(tools: ReadonlyArray<ToolDef>): unknown[];
29
+ /**
30
+ * LangChain / CrewAI StructuredTool descriptors. LangChain consumes a name +
31
+ * description + JSON-schema args; this shape is accepted by
32
+ * `convertToOpenAITool`-style helpers and by CrewAI's tool adapters.
33
+ */
34
+ export declare function toLangChainTools(tools: ReadonlyArray<ToolDef>): unknown[];
35
+ /**
36
+ * OpenAPI 3.1 document. Each MCP tool becomes a POST operation under
37
+ * /mcp/tools/{name}, with the tool's input schema as the request body. This lets
38
+ * any OpenAPI-driven agent (OpenAI Assistants "from OpenAPI", Postman, codegen)
39
+ * wrap cachly automatically. The operation maps 1:1 onto an MCP tools/call.
40
+ */
41
+ export declare function toOpenAPI(tools: ReadonlyArray<ToolDef>, version: string, serverUrl?: string): Record<string, unknown>;
42
+ /** Render the requested format as a pretty-printed JSON string. */
43
+ export declare function renderToolSpecs(tools: ReadonlyArray<ToolDef>, format: SpecFormat, version: string): string;
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Agent-framework tool-spec exporter.
3
+ *
4
+ * cachly exposes 114 MCP tools. MCP-native clients (Claude Code, Cursor,
5
+ * Windsurf, Copilot) speak MCP directly. But the wider agent ecosystem —
6
+ * OpenAI Assistants / function calling, the Anthropic Messages API, LangChain,
7
+ * CrewAI, AutoGen — each want the SAME tool definitions in their own dialect.
8
+ *
9
+ * Rather than hand-maintain four copies, we derive every dialect from the single
10
+ * TOOLS source of truth. Zero new runtime dependencies: these are just shape
11
+ * transforms over the JSON-Schema input schemas the tools already declare.
12
+ *
13
+ * CLI: npx @cachly-dev/mcp-server tool-specs --format=openapi|openai|anthropic|langchain
14
+ */
15
+ const SERVER_TITLE = 'cachly AI Brain — MCP tools';
16
+ /** OpenAI function-calling / Assistants tool array. */
17
+ export function toOpenAITools(tools) {
18
+ return tools.map(t => ({
19
+ type: 'function',
20
+ function: {
21
+ name: t.name,
22
+ description: t.description,
23
+ parameters: t.inputSchema ?? { type: 'object', properties: {} },
24
+ },
25
+ }));
26
+ }
27
+ /** Anthropic Messages API tool array (input_schema, not parameters). */
28
+ export function toAnthropicTools(tools) {
29
+ return tools.map(t => ({
30
+ name: t.name,
31
+ description: t.description,
32
+ input_schema: t.inputSchema ?? { type: 'object', properties: {} },
33
+ }));
34
+ }
35
+ /**
36
+ * LangChain / CrewAI StructuredTool descriptors. LangChain consumes a name +
37
+ * description + JSON-schema args; this shape is accepted by
38
+ * `convertToOpenAITool`-style helpers and by CrewAI's tool adapters.
39
+ */
40
+ export function toLangChainTools(tools) {
41
+ return tools.map(t => ({
42
+ name: t.name,
43
+ description: t.description,
44
+ schema: t.inputSchema ?? { type: 'object', properties: {} },
45
+ }));
46
+ }
47
+ /**
48
+ * OpenAPI 3.1 document. Each MCP tool becomes a POST operation under
49
+ * /mcp/tools/{name}, with the tool's input schema as the request body. This lets
50
+ * any OpenAPI-driven agent (OpenAI Assistants "from OpenAPI", Postman, codegen)
51
+ * wrap cachly automatically. The operation maps 1:1 onto an MCP tools/call.
52
+ */
53
+ export function toOpenAPI(tools, version, serverUrl = 'https://api.cachly.dev') {
54
+ const paths = {};
55
+ for (const t of tools) {
56
+ paths[`/mcp/tools/${t.name}`] = {
57
+ post: {
58
+ operationId: t.name,
59
+ summary: t.description.split('. ')[0],
60
+ description: t.description,
61
+ requestBody: {
62
+ required: (t.inputSchema?.required?.length ?? 0) > 0,
63
+ content: {
64
+ 'application/json': {
65
+ schema: t.inputSchema ?? { type: 'object', properties: {} },
66
+ },
67
+ },
68
+ },
69
+ responses: {
70
+ '200': {
71
+ description: 'Tool result (MCP content blocks).',
72
+ content: {
73
+ 'application/json': {
74
+ schema: {
75
+ type: 'object',
76
+ properties: {
77
+ content: {
78
+ type: 'array',
79
+ items: {
80
+ type: 'object',
81
+ properties: { type: { type: 'string' }, text: { type: 'string' } },
82
+ },
83
+ },
84
+ },
85
+ },
86
+ },
87
+ },
88
+ },
89
+ },
90
+ },
91
+ };
92
+ }
93
+ return {
94
+ openapi: '3.1.0',
95
+ info: {
96
+ title: SERVER_TITLE,
97
+ version,
98
+ description: 'OpenAPI projection of the cachly MCP tool surface. Each path maps 1:1 onto an MCP ' +
99
+ 'tools/call. Authenticate with a bearer token (CACHLY_JWT, a cky_ API key, or an ' +
100
+ 'OAuth2 client_credentials access token).',
101
+ },
102
+ servers: [{ url: serverUrl }],
103
+ components: {
104
+ securitySchemes: {
105
+ bearerAuth: { type: 'http', scheme: 'bearer', bearerFormat: 'JWT' },
106
+ },
107
+ },
108
+ security: [{ bearerAuth: [] }],
109
+ paths,
110
+ };
111
+ }
112
+ /** Render the requested format as a pretty-printed JSON string. */
113
+ export function renderToolSpecs(tools, format, version) {
114
+ switch (format) {
115
+ case 'openapi': return JSON.stringify(toOpenAPI(tools, version), null, 2);
116
+ case 'openai': return JSON.stringify({ tools: toOpenAITools(tools) }, null, 2);
117
+ case 'anthropic': return JSON.stringify({ tools: toAnthropicTools(tools) }, null, 2);
118
+ case 'langchain': return JSON.stringify({ tools: toLangChainTools(tools) }, null, 2);
119
+ }
120
+ }
121
+ //# sourceMappingURL=toolspecs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolspecs.js","sourceRoot":"","sources":["../../src/toolspecs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAUH,MAAM,YAAY,GAAG,6BAA6B,CAAC;AAEnD,uDAAuD;AACvD,MAAM,UAAU,aAAa,CAAC,KAA6B;IACzD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE;YACR,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,UAAU,EAAE,CAAC,CAAC,WAAW,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;SAChE;KACF,CAAC,CAAC,CAAC;AACN,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,gBAAgB,CAAC,KAA6B;IAC5D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,YAAY,EAAE,CAAC,CAAC,WAAW,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;KAClE,CAAC,CAAC,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA6B;IAC5D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CA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I,EAAE,CAAC,CAAC,CAAC;IACvF,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cachly-dev/mcp-server",
3
- "version": "0.10.83",
3
+ "version": "0.10.84",
4
4
  "mcpName": "io.github.cachly-dev/cachly-mcp",
5
5
  "description": "Your AI forgets everything between sessions. cachly fixes that permanently. Persistent memory + causal root-cause analysis for Claude Code, Cursor, Copilot & Windsurf. Learns from every bug fix, git commit, and CI run automatically. Arrives pre-briefed. Predicts failures before they happen. 107 MCP tools · Free tier forever · GDPR · EU servers.",
6
6
  "type": "module",
package/server.json CHANGED
@@ -6,13 +6,13 @@
6
6
  "url": "https://github.com/cachly-dev/cachly-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.10.83",
9
+ "version": "0.10.84",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "name": "@cachly-dev/mcp-server",
14
14
  "identifier": "@cachly-dev/mcp-server",
15
- "version": "0.10.83",
15
+ "version": "0.10.84",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  }