@mrxkun/mcfast-mcp 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.
Files changed (3) hide show
  1. package/README.md +106 -0
  2. package/package.json +32 -0
  3. package/src/index.js +152 -0
package/README.md ADDED
@@ -0,0 +1,106 @@
1
+ # @mrxkun/mcfast-mcp
2
+
3
+ **Ultra-fast code editing for AI agents** powered by [Mercury Coder](https://inceptionlabs.ai) Cloud.
4
+
5
+ Transform any MCP-enabled AI (Claude Code, Cursor, Windsurf, OpenCode) into a **Priority Coder** with intelligent multi-file editing capabilities.
6
+
7
+ ---
8
+
9
+ ## 🚀 Quick Start
10
+
11
+ ### 1. Get Your Token
12
+ Visit [mcfast.vercel.app](https://mcfast.vercel.app) to sign up and get your free `MCFAST_TOKEN`.
13
+
14
+ ### 2. Install & Configure
15
+
16
+ **Claude Code / Claude Desktop:**
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "mcfast": {
21
+ "command": "npx",
22
+ "args": ["-y", "@mrxkun/mcfast-mcp"],
23
+ "env": {
24
+ "MCFAST_TOKEN": "mcfast_..."
25
+ }
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ **Cursor / Windsurf:**
32
+ 1. Settings → Features → MCP → Add New Server
33
+ 2. Name: `mcfast`
34
+ 3. Command: `npx -y @mrxkun/mcfast-mcp`
35
+ 4. Environment: `MCFAST_TOKEN=mcfast_...`
36
+
37
+ **VS Code / OpenCode:**
38
+ ```json
39
+ {
40
+ "mcp.servers": {
41
+ "mcfast": {
42
+ "command": "npx",
43
+ "args": ["-y", "@mrxkun/mcfast-mcp"],
44
+ "env": { "MCFAST_TOKEN": "mcfast_..." }
45
+ }
46
+ }
47
+ }
48
+ ```
49
+
50
+ ---
51
+
52
+ ## 🛠️ Available Tools
53
+
54
+ ### `apply_fast`
55
+ Apply intelligent code edits to multiple files simultaneously.
56
+
57
+ **Example:**
58
+ ```
59
+ instruction: "Add error handling to all fetch calls"
60
+ files: { "src/api.js": "<content>", "src/utils.js": "<content>" }
61
+ dryRun: false
62
+ ```
63
+
64
+ **Features:**
65
+ - Automatic strategy selection (SEARCH_REPLACE, MULTI_EDIT, FULL_REWRITE)
66
+ - Deterministic diff generation
67
+ - Syntax-aware transformations
68
+
69
+ ### `apply_search_replace`
70
+ Fast targeted replacements for simple edits.
71
+
72
+ **Example:**
73
+ ```
74
+ files: { "src/config.js": "<content>" }
75
+ search: "localhost:3000"
76
+ replace: "api.example.com"
77
+ ```
78
+
79
+ ---
80
+
81
+ ## 🔒 Privacy & Security
82
+
83
+ - **Zero Persistence:** Code is processed in-memory and discarded immediately
84
+ - **Open Source Client:** Audit the source at [github.com/ndpmmo/mcfast](https://github.com/ndpmmo/mcfast). Current stable version: `1.0.2`.
85
+ - **Token Masking:** Your `MCFAST_TOKEN` is never logged
86
+
87
+ ---
88
+
89
+ ## 💎 Priority Coder Mode
90
+
91
+ Upgrade to **Priority Coder** by adding your own Mercury API key in the [dashboard settings](https://mcfast.vercel.app):
92
+ - Dedicated bandwidth (no shared rate limits)
93
+ - Higher throughput for large codebases
94
+ - Direct access to Mercury Coder infrastructure
95
+
96
+ ---
97
+
98
+ ## 📚 Documentation
99
+
100
+ - [Dashboard](https://mcfast.vercel.app)
101
+ - [GitHub Repository](https://github.com/ndpmmo/mcfast)
102
+ - [Mercury Coder Docs](https://inceptionlabs.ai)
103
+
104
+ ## 📜 License
105
+
106
+ MIT © [mrxkun](https://github.com/mrxkun)
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@mrxkun/mcfast-mcp",
3
+ "version": "1.0.2",
4
+ "description": "Ultra-fast code editing via Mercury Coder Cloud API.",
5
+ "type": "module",
6
+ "bin": {
7
+ "mcfast-mcp": "src/index.js"
8
+ },
9
+ "main": "src/index.js",
10
+ "files": [
11
+ "src/"
12
+ ],
13
+ "engines": {
14
+ "node": ">=18"
15
+ },
16
+ "keywords": [
17
+ "mcp",
18
+ "claude",
19
+ "cursor",
20
+ "mercury",
21
+ "fast-apply"
22
+ ],
23
+ "author": "mrxkun",
24
+ "license": "MIT",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/ndpmmo/mcfast.git"
28
+ },
29
+ "dependencies": {
30
+ "@modelcontextprotocol/sdk": "^0.6.0"
31
+ }
32
+ }
package/src/index.js ADDED
@@ -0,0 +1,152 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * mcfast MCP Client v1.0.0
5
+ * Proxies code edit requests to mcfast Cloud (Vercel)
6
+ */
7
+
8
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
9
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
10
+ import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprotocol/sdk/types.js";
11
+
12
+ const API_URL = "https://mcfast.vercel.app/api/v1";
13
+ const TOKEN = process.env.MCFAST_TOKEN;
14
+
15
+ if (!TOKEN) {
16
+ console.error("❌ Error: MCFAST_TOKEN is missing. Get one at https://mcfast.vercel.app");
17
+ process.exit(1);
18
+ }
19
+
20
+ const server = new Server(
21
+ {
22
+ name: "mcfast",
23
+ version: "1.0.0",
24
+ },
25
+ {
26
+ capabilities: {
27
+ tools: {},
28
+ },
29
+ }
30
+ );
31
+
32
+ /**
33
+ * MCP Tool Definition: apply_fast
34
+ */
35
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
36
+ return {
37
+ tools: [
38
+ {
39
+ name: "apply_fast",
40
+ description: "Apply complex multi-file code edits intelligently using Mercury Coder Cloud. Suitable for refactoring, bug fixes, and feature implementation across multiple files.",
41
+ inputSchema: {
42
+ type: "object",
43
+ properties: {
44
+ instruction: {
45
+ type: "string",
46
+ description: "The natural language instruction describing what changes to make.",
47
+ },
48
+ files: {
49
+ type: "object",
50
+ description: "A dictionary where keys are file paths and values are CURRENT file contents. Provide context for files you want to edit.",
51
+ additionalProperties: { type: "string" }
52
+ },
53
+ dryRun: {
54
+ type: "boolean",
55
+ description: "If true, returns the diff but does not apply changes (for preview). Default: false.",
56
+ },
57
+ },
58
+ required: ["instruction", "files"],
59
+ },
60
+ },
61
+ {
62
+ name: "apply_search_replace",
63
+ description: "Apply targeted search/replace edits. Faster and cheaper for simple replacements.",
64
+ inputSchema: {
65
+ type: "object",
66
+ properties: {
67
+ files: {
68
+ type: "object",
69
+ description: "Map of file paths to content.",
70
+ additionalProperties: { type: "string" }
71
+ },
72
+ search: { type: "string", description: "Exact string to search for." },
73
+ replace: { type: "string", description: "String to replace with." }
74
+ },
75
+ required: ["files", "search", "replace"]
76
+ }
77
+ }
78
+ ],
79
+ };
80
+ });
81
+
82
+ /**
83
+ * Tool Execution Handler
84
+ */
85
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
86
+ const { name, arguments: args } = request.params;
87
+
88
+ if (name === "apply_fast") {
89
+ return await handleApplyFast(args);
90
+ } else if (name === "apply_search_replace") {
91
+ // Placeholder: You could implement a dedicated endpoint for this later to save tokens
92
+ // For now, we route it to apply_fast with a synthesized instruction
93
+ return await handleApplyFast({
94
+ instruction: `Replace checking for exact match:\nSEARCH:\n${args.search}\n\nREPLACE WITH:\n${args.replace}`,
95
+ files: args.files,
96
+ dryRun: false
97
+ });
98
+ }
99
+
100
+ throw new Error(`Tool not found: ${name}`);
101
+ });
102
+
103
+ async function handleApplyFast({ instruction, files, dryRun }) {
104
+ try {
105
+ const response = await fetch(`${API_URL}/apply`, {
106
+ method: "POST",
107
+ headers: {
108
+ "Content-Type": "application/json",
109
+ "Authorization": `Bearer ${TOKEN}`,
110
+ },
111
+ body: JSON.stringify({ instruction, files, dryRun }),
112
+ });
113
+
114
+ if (!response.ok) {
115
+ const errorText = await response.text();
116
+ return {
117
+ content: [{ type: "text", text: `Cloud Error (${response.status}): ${errorText}` }],
118
+ isError: true,
119
+ };
120
+ }
121
+
122
+ const data = await response.json();
123
+
124
+ // Format the result nicely for the AI Agent consuming this tool
125
+ let output = `✅ Edit Applied Successfully via ${data.strategy} (${data.latency_ms}ms)\n\n`;
126
+
127
+ if (data.diffs && Object.keys(data.diffs).length > 0) {
128
+ for (const [path, diff] of Object.entries(data.diffs)) {
129
+ output += `📄 ${path}:\n${diff}\n\n`;
130
+ }
131
+ } else {
132
+ output += "No changes detected or files were identical.";
133
+ }
134
+
135
+ return {
136
+ content: [{ type: "text", text: output }],
137
+ };
138
+
139
+ } catch (error) {
140
+ return {
141
+ content: [{ type: "text", text: `Client Connection Error: ${error.message}` }],
142
+ isError: true,
143
+ };
144
+ }
145
+ }
146
+
147
+ /**
148
+ * Start Server
149
+ */
150
+ const transport = new StdioServerTransport();
151
+ await server.connect(transport);
152
+ console.error("mcfast MCP v1.0.0 running on stdio");