@kasarlabs/cairo-coder-mcp 0.1.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 ADDED
@@ -0,0 +1,122 @@
1
+ <div align="center">
2
+ <img src="./cairo-grey.png" alt="Cairo Coder MCP Logo" width="300"/>
3
+
4
+ [![npm version](https://img.shields.io/npm/v/@kasarlabs/cairo-coder-api.svg)](https://www.npmjs.com/package/@kasarlabs/cairo-coder-api)
5
+ [![npm downloads](https://img.shields.io/npm/dm/@kasarlabs/cairo-coder-api.svg)](https://www.npmjs.com/package/@kasarlabs/cairo-coder-api)
6
+ [![GitHub stars](https://img.shields.io/github/stars/kasarlabs/cairo-coder-mcp.svg)](https://github.com/kasarlabs/cairo-coder-mcp/stargazers)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+ </div>
9
+
10
+ # Cairo Coder MCP Server
11
+
12
+ A Model Context Protocol (MCP) server for Cairo and Starknet development assistance via the Cairo Coder API.
13
+
14
+ ## Quick Start
15
+
16
+ Use this MCP server directly with npx:
17
+
18
+ ```bash
19
+ npx -y @kasarlabs/cairo-coder-api
20
+ ```
21
+
22
+ ## Configuration
23
+
24
+ ### Environment Variables
25
+
26
+ - `CAIRO_CODER_API_KEY`: Your Cairo Coder API key (required)
27
+
28
+ ### Claude Desktop Setup
29
+
30
+ Add this configuration to your `claude_desktop_config.json`:
31
+
32
+ ```json
33
+ {
34
+ "mcpServers": {
35
+ "cairo-coder": {
36
+ "command": "npx",
37
+ "args": ["-y", "@kasarlabs/cairo-coder-api"],
38
+ "env": {
39
+ "CAIRO_CODER_API_KEY": "your-api-key-here"
40
+ }
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ ## Available Tools
47
+
48
+ ### assist_with_cairo
49
+
50
+ Get help with Cairo and Starknet development tasks.
51
+
52
+ **Parameters:**
53
+
54
+ - `query` (string, required): Your Cairo/Starknet development question
55
+ - `context` (string, optional): Additional context or code snippets
56
+
57
+ **Examples:**
58
+
59
+ ```typescript
60
+ // Simple request
61
+ {
62
+ "query": "Write a simple Cairo contract that implements a counter"
63
+ }
64
+
65
+ // With context
66
+ {
67
+ "query": "How can I optimize this contract?",
68
+ "context": "#[starknet::contract]\nmod Counter {\n // existing code here\n}"
69
+ }
70
+ ```
71
+
72
+ ## What You Can Do
73
+
74
+ - **Write Cairo code**: Generate smart contracts and Cairo code
75
+ - **Refactor code**: Improve and optimize existing code
76
+ - **Implement features**: Complete TODOs and implement specific functionality
77
+ - **Learn Starknet**: Get contextual information about the Starknet ecosystem
78
+ - **Best practices**: Receive advice based on Cairo/Starknet documentation
79
+
80
+ ## Tips for Better Results
81
+
82
+ - Use specific queries (e.g., "Using OpenZeppelin to build an ERC20" instead of just "ERC20")
83
+ - Include relevant code snippets when working with existing code
84
+ - Provide necessary context for more accurate responses
85
+
86
+ ## Development
87
+
88
+ ### Prerequisites
89
+
90
+ - Node.js >= 18
91
+ - npm or yarn
92
+
93
+ ### Local Installation
94
+
95
+ ```bash
96
+ git clone <repository-url>
97
+ cd cairo-coder-api
98
+ npm install
99
+ ```
100
+
101
+ ### Available Scripts
102
+
103
+ ```bash
104
+ npm run build # Build the project
105
+ npm run dev # Start in development mode
106
+ npm start # Start in production mode
107
+ ```
108
+
109
+ ## License
110
+
111
+ MIT
112
+
113
+ ## Support
114
+
115
+ For issues and questions:
116
+
117
+ - GitHub Issues: [Create an issue](https://github.com/kasarlabs/cairo-coder-api/issues)
118
+ - MCP Documentation: [Model Context Protocol](https://modelcontextprotocol.io/)
119
+
120
+ ## Contributing
121
+
122
+ Contributions are welcome! Please check the contribution guidelines before submitting a PR.
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ import "dotenv/config";
3
+ /**
4
+ * MCP Server implementation for Cairo Coder API integration
5
+ * Provides AI-powered assistance for Cairo and Starknet development
6
+ */
7
+ declare class CairoCoderMCPServer {
8
+ private server;
9
+ private apiKey;
10
+ private apiUrl;
11
+ private isLocalMode;
12
+ /**
13
+ * Initializes the Cairo Coder MCP Server
14
+ * @throws {Error} If CAIRO_CODER_API_KEY environment variable is not set when using public API
15
+ */
16
+ constructor();
17
+ /**
18
+ * Sets up the tool handlers for the MCP server
19
+ * Configures the assist_with_cairo tool for Cairo/Starknet development assistance
20
+ */
21
+ private setupToolHandlers;
22
+ /**
23
+ * Handles Cairo assistance requests by calling the Cairo Coder API
24
+ * @param args - The arguments containing query, optional code snippets, and conversation history
25
+ * @returns The response from the Cairo Coder API or an error message
26
+ */
27
+ private handleCairoAssistance;
28
+ /**
29
+ * Sets up error handling for the server
30
+ * Configures error logging and graceful shutdown on SIGINT
31
+ */
32
+ private setupErrorHandling;
33
+ /**
34
+ * Starts the MCP server with stdio transport
35
+ * @throws {Error} If the server fails to start
36
+ */
37
+ run(): Promise<void>;
38
+ }
39
+ export default CairoCoderMCPServer;
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AAsCvB;;;GAGG;AACH,cAAM,mBAAmB;IACvB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,WAAW,CAAU;IAE7B;;;OAGG;;IAwCH;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IA8DzB;;;;OAIG;YACW,qBAAqB;IAuFnC;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAW1B;;;OAGG;IACG,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAK3B;AAgBD,eAAe,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,211 @@
1
+ #!/usr/bin/env node
2
+ import "dotenv/config";
3
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
6
+ import fetch from "node-fetch";
7
+ /**
8
+ * MCP Server implementation for Cairo Coder API integration
9
+ * Provides AI-powered assistance for Cairo and Starknet development
10
+ */
11
+ class CairoCoderMCPServer {
12
+ server;
13
+ apiKey;
14
+ apiUrl;
15
+ isLocalMode;
16
+ /**
17
+ * Initializes the Cairo Coder MCP Server
18
+ * @throws {Error} If CAIRO_CODER_API_KEY environment variable is not set when using public API
19
+ */
20
+ constructor() {
21
+ this.server = new Server({
22
+ name: "cairo-coder-api",
23
+ version: "1.0.0",
24
+ capabilities: {
25
+ tools: {},
26
+ },
27
+ });
28
+ // Check if local endpoint is specified
29
+ const localEndpoint = process.env.CAIRO_CODER_API_ENDPOINT;
30
+ if (localEndpoint) {
31
+ // Local mode: use custom endpoint, no API key required
32
+ this.isLocalMode = true;
33
+ this.apiUrl = `${localEndpoint}/v1/chat/completions`;
34
+ this.apiKey = "";
35
+ console.error(`Cairo Coder MCP server configured for local mode: ${this.apiUrl}`);
36
+ }
37
+ else {
38
+ // Public API mode: use official endpoint, API key required
39
+ this.isLocalMode = false;
40
+ this.apiUrl = "https://api.cairo-coder.com/v1/chat/completions";
41
+ this.apiKey = process.env.CAIRO_CODER_API_KEY || "";
42
+ if (!this.apiKey) {
43
+ console.error("Error: CAIRO_CODER_API_KEY environment variable is required when using public API");
44
+ process.exit(1);
45
+ }
46
+ console.error("Cairo Coder MCP server configured for public API mode");
47
+ }
48
+ this.setupToolHandlers();
49
+ this.setupErrorHandling();
50
+ }
51
+ /**
52
+ * Sets up the tool handlers for the MCP server
53
+ * Configures the assist_with_cairo tool for Cairo/Starknet development assistance
54
+ */
55
+ setupToolHandlers() {
56
+ this.server.setRequestHandler(ListToolsRequestSchema, async () => {
57
+ return {
58
+ tools: [
59
+ {
60
+ name: "assist_with_cairo",
61
+ description: `Provides assistance with Cairo and Starknet development tasks through AI-powered analysis.
62
+
63
+ Call this tool when the user's request involves **writing, refactoring, implementing from scratch, or completing specific parts (like TODOs)** of Cairo code or smart contracts.
64
+
65
+ The tool analyzes the query and context against Cairo/Starknet best practices and documentation, returning helpful information to generate accurate code or explanations.
66
+
67
+ This tool should also be called to get a better understanding of Starknet's ecosystem, features, and capacities.`,
68
+ inputSchema: {
69
+ type: "object",
70
+ properties: {
71
+ query: {
72
+ type: "string",
73
+ description: "The user's question regarding Cairo and Starknet development. Try to be as specific as possible for better results (e.g., 'Using OpenZeppelin to build an ERC20' rather than just 'ERC20').",
74
+ },
75
+ codeSnippets: {
76
+ type: "array",
77
+ items: {
78
+ type: "string",
79
+ },
80
+ description: "Optional: Code snippets for context. This will help the tool understand the user's intent and provide more accurate answers. Provide as much relevant code as possible to fit the user's request.",
81
+ },
82
+ history: {
83
+ type: "array",
84
+ items: {
85
+ type: "string",
86
+ },
87
+ description: "Optional: The preceding conversation history. This can help the tool understand the context of the discussion and provide more accurate answers.",
88
+ },
89
+ },
90
+ required: ["query"],
91
+ },
92
+ },
93
+ ],
94
+ };
95
+ });
96
+ this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
97
+ const { name, arguments: args } = request.params;
98
+ if (name === "assist_with_cairo") {
99
+ return await this.handleCairoAssistance(args);
100
+ }
101
+ throw new Error(`Unknown tool: ${name}`);
102
+ });
103
+ }
104
+ /**
105
+ * Handles Cairo assistance requests by calling the Cairo Coder API
106
+ * @param args - The arguments containing query, optional code snippets, and conversation history
107
+ * @returns The response from the Cairo Coder API or an error message
108
+ */
109
+ async handleCairoAssistance(args) {
110
+ try {
111
+ const { query, codeSnippets, history } = args;
112
+ if (!query) {
113
+ throw new Error("Query parameter is required");
114
+ }
115
+ let contextualMessage = query;
116
+ if (codeSnippets && codeSnippets.length > 0) {
117
+ contextualMessage += `\n\nCode snippets for context:\n${codeSnippets.join("\n\n")}`;
118
+ }
119
+ if (history && history.length > 0) {
120
+ contextualMessage = `Previous conversation context:\n${history.join("\n")}\n\nCurrent query: ${contextualMessage}`;
121
+ }
122
+ const requestBody = {
123
+ messages: [
124
+ {
125
+ role: "user",
126
+ content: contextualMessage,
127
+ },
128
+ ],
129
+ };
130
+ // Prepare headers based on mode
131
+ const headers = {
132
+ "Content-Type": "application/json",
133
+ mcp: "true",
134
+ };
135
+ // Only add API key header in public API mode
136
+ if (!this.isLocalMode && this.apiKey) {
137
+ headers["x-api-key"] = this.apiKey;
138
+ }
139
+ const response = await fetch(this.apiUrl, {
140
+ method: "POST",
141
+ headers,
142
+ body: JSON.stringify(requestBody),
143
+ });
144
+ if (!response.ok) {
145
+ const errorText = await response.text();
146
+ throw new Error(`API request failed: ${response.status} ${response.statusText} - ${errorText}`);
147
+ }
148
+ const data = (await response.json());
149
+ if (!data.choices || data.choices.length === 0) {
150
+ throw new Error("No response received from Cairo Coder API");
151
+ }
152
+ const assistantResponse = data.choices[0].message.content;
153
+ return {
154
+ content: [
155
+ {
156
+ type: "text",
157
+ text: assistantResponse,
158
+ },
159
+ ],
160
+ };
161
+ }
162
+ catch (error) {
163
+ const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
164
+ return {
165
+ content: [
166
+ {
167
+ type: "text",
168
+ text: `Error: ${errorMessage}`,
169
+ },
170
+ ],
171
+ isError: true,
172
+ };
173
+ }
174
+ }
175
+ /**
176
+ * Sets up error handling for the server
177
+ * Configures error logging and graceful shutdown on SIGINT
178
+ */
179
+ setupErrorHandling() {
180
+ this.server.onerror = (error) => {
181
+ console.error("[MCP Error]", error);
182
+ };
183
+ process.on("SIGINT", async () => {
184
+ await this.server.close();
185
+ process.exit(0);
186
+ });
187
+ }
188
+ /**
189
+ * Starts the MCP server with stdio transport
190
+ * @throws {Error} If the server fails to start
191
+ */
192
+ async run() {
193
+ const transport = new StdioServerTransport();
194
+ console.error("Cairo Coder MCP server running on stdio");
195
+ await this.server.connect(transport);
196
+ }
197
+ }
198
+ /**
199
+ * Main entry point for the application
200
+ * Creates and starts the Cairo Coder MCP server
201
+ */
202
+ async function main() {
203
+ const server = new CairoCoderMCPServer();
204
+ await server.run();
205
+ }
206
+ main().catch((error) => {
207
+ console.error("Fatal error in main():", error);
208
+ process.exit(1);
209
+ });
210
+ export default CairoCoderMCPServer;
211
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,MAAM,YAAY,CAAC;AA8B/B;;;GAGG;AACH,MAAM,mBAAmB;IACf,MAAM,CAAS;IACf,MAAM,CAAS;IACf,MAAM,CAAS;IACf,WAAW,CAAU;IAE7B;;;OAGG;IACH;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC;YACvB,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE,OAAO;YAChB,YAAY,EAAE;gBACZ,KAAK,EAAE,EAAE;aACV;SACF,CAAC,CAAC;QAEH,uCAAuC;QACvC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;QAE3D,IAAI,aAAa,EAAE,CAAC;YAClB,uDAAuD;YACvD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,MAAM,GAAG,GAAG,aAAa,sBAAsB,CAAC;YACrD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YACjB,OAAO,CAAC,KAAK,CACX,qDAAqD,IAAI,CAAC,MAAM,EAAE,CACnE,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,2DAA2D;YAC3D,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;YACzB,IAAI,CAAC,MAAM,GAAG,iDAAiD,CAAC;YAChE,IAAI,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AO,GAAG,CAAC,KAAK,EAAE,EAAE;YAC9B,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;QACtC,CAAC,CAAC;QAEF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;YAC9B,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,GAAG;QACP,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;QACzD,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;CACF;AAED;;;GAGG;AACH,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAI,mBAAmB,EAAE,CAAC;IACzC,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@kasarlabs/cairo-coder-mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP server to interact with the Cairo Coder API",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/index.js",
10
+ "types": "./dist/index.d.ts"
11
+ }
12
+ },
13
+ "bin": {
14
+ "cairo-coder-api": "./dist/index.js"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "LICENSE"
20
+ ],
21
+ "keywords": [
22
+ "mcp",
23
+ "cairo",
24
+ "starknet",
25
+ "blockchain",
26
+ "smart-contracts",
27
+ "cli",
28
+ "npx"
29
+ ],
30
+ "author": "KasarLabs",
31
+ "license": "MIT",
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "dependencies": {
36
+ "@modelcontextprotocol/sdk": "^0.4.0",
37
+ "dotenv": "^16.5.0",
38
+ "node-fetch": "^3.3.2"
39
+ },
40
+ "devDependencies": {
41
+ "@types/node": "^20.0.0",
42
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
43
+ "@typescript-eslint/parser": "^6.0.0",
44
+ "eslint": "^8.0.0",
45
+ "tsx": "^4.7.0",
46
+ "typescript": "^5.0.0"
47
+ },
48
+ "engines": {
49
+ "node": ">=18"
50
+ },
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "https://github.com/kasarlabs/cairo-coder-mcp"
54
+ },
55
+ "bugs": {
56
+ "url": "https://github.com/kasarlabs/cairo-coder-mcp/issues"
57
+ },
58
+ "homepage": "https://github.com/kasarlabs/cairo-coder-mcp#readme",
59
+ "scripts": {
60
+ "build": "tsc && chmod +x dist/index.js",
61
+ "start": "node dist/index.js",
62
+ "dev": "tsx src/index.ts",
63
+ "lint": "eslint src/**/*.ts",
64
+ "lint:fix": "eslint src/**/*.ts --fix",
65
+ "clean": "rm -rf dist node_modules",
66
+ "test": "echo \"Error: no test specified\" && exit 1"
67
+ }
68
+ }