genudo-mcp-client 1.0.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/.env.example ADDED
@@ -0,0 +1,13 @@
1
+ # Genudo MCP Client Configuration
2
+
3
+ # Your Genudo API Key (REQUIRED)
4
+ # Get this from your Genudo account settings
5
+ GENUDO_API_KEY=your_api_key_here
6
+
7
+ # Base URL (OPTIONAL - defaults to https://api.genudo.ai)
8
+ # For self-hosted instances or local development
9
+ # GENUDO_BASE_URL=https://your-instance.com
10
+
11
+ # Allow insecure SSL (OPTIONAL - defaults to false)
12
+ # Only use for local development with self-signed certificates
13
+ # GENUDO_ALLOW_INSECURE_SSL=true
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Genudo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,253 @@
1
+ # Genudo MCP Client
2
+
3
+ [![npm version](https://img.shields.io/npm/v/genudo-mcp-client)](https://www.npmjs.com/package/genudo-mcp-client)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org)
6
+
7
+ A lightweight bridge that connects [Claude Code](https://code.claude.com) to Genudo's Model Context Protocol (MCP) server, enabling AI-powered workflow automation directly from your Claude Code interface.
8
+
9
+ ## Overview
10
+
11
+ Genudo MCP Client bridges the communication gap between Claude Code's stdio-based MCP implementation and Genudo's HTTP/SSE-based MCP server. This allows you to leverage Genudo's powerful business automation tools directly within your Claude Code conversations.
12
+
13
+ ## Features
14
+
15
+ Access Genudo's business automation tools directly from Claude Code. The server exposes 21 tools across five areas:
16
+
17
+ - **📊 Analytics** — account summary, messaging volume stats, AI performance & cost (`get_account_summary`, `get_messaging_stats`, `get_ai_performance`)
18
+ - **🔎 Read your workspace** — list pipelines, stages, contacts, messages, opportunities, and variables (`list_pipelines`, `list_pipeline_stages`, `list_contacts`, `list_messages`, `list_opportunities`, `list_variables`)
19
+ - **🚀 Build pipelines** — a guided step-by-step builder plus direct create/update (`start_pipeline_journey`, `get_pipeline_options`, `create_pipeline`, `update_pipeline`)
20
+ - **🧩 Stages & actions** — configure pipeline stages and external-integration actions/webhooks (`create_stage`, `update_stage`, `create_action`, `update_action`)
21
+ - **⚙️ Variables & opportunities** — manage pipeline variables and update opportunities (`create_variable`, `update_variable`, `delete_variable`, `update_opportunities`)
22
+
23
+ ### Three workflows to start with
24
+
25
+ 1. **Audit my AI business operations** — Claude pulls your account, messaging, and AI-cost stats and surfaces the top fixes.
26
+ 2. **Analyze my agent performance** — spot expensive agents, low-completion stages, and actions that aren't triggering.
27
+ 3. **Create or improve a pipeline** — e.g. "Create a Messenger sales agent for a summer camp; collect name, phone, branch, child age; escalate on special-needs questions."
28
+
29
+ ## Quick Start
30
+
31
+ One command — no clone, no manual config:
32
+
33
+ ```bash
34
+ claude mcp add --env GENUDO_API_KEY=YOUR_KEY --transport stdio genudo -- npx -y genudo-mcp-client
35
+ ```
36
+
37
+ Replace `YOUR_KEY` with your Genudo API key (Settings → API Keys). Restart Claude Code and start using Genudo tools!
38
+
39
+ ## Prerequisites
40
+
41
+ - Node.js 18.0.0 or higher
42
+ - A Genudo account with API access
43
+ - Your Genudo API key
44
+
45
+ ## Installation
46
+
47
+ ### Recommended: one command
48
+
49
+ ```bash
50
+ claude mcp add --env GENUDO_API_KEY=YOUR_KEY --transport stdio genudo -- npx -y genudo-mcp-client
51
+ ```
52
+
53
+ `npx` fetches and runs the published package — no clone, no local path. Get your API key from Settings → API Keys, then restart Claude Code.
54
+
55
+ ### Alternative: from source
56
+
57
+ For local development or contributions:
58
+
59
+ ```bash
60
+ git clone https://github.com/genudo-ai/genudo_mcp.git
61
+ cd genudo_mcp
62
+ npm install
63
+ ```
64
+
65
+ Then configure Claude Code manually (see Configuration section below).
66
+
67
+ ## Configuration
68
+
69
+ ### Step 1: Get Your API Key
70
+
71
+ 1. Log in to your [Genudo account](https://genudo.ai)
72
+ 2. Navigate to **Settings** → **API Keys**
73
+ 3. Click **Generate New API Key**
74
+ 4. Copy your API key (keep it secure!)
75
+
76
+ ### Step 2: Connect your MCP client
77
+
78
+ **Recommended — Claude Code, one command:**
79
+
80
+ ```bash
81
+ claude mcp add --env GENUDO_API_KEY=YOUR_KEY --transport stdio genudo -- npx -y genudo-mcp-client
82
+ ```
83
+
84
+ **Other clients (Codex, Cursor, Windsurf, Claude Desktop):** same package, add this block to the client's MCP config:
85
+
86
+ ```json
87
+ {
88
+ "mcpServers": {
89
+ "genudo": {
90
+ "command": "npx",
91
+ "args": ["-y", "genudo-mcp-client"],
92
+ "env": {
93
+ "GENUDO_API_KEY": "your_api_key_here"
94
+ }
95
+ }
96
+ }
97
+ }
98
+ ```
99
+
100
+ <details>
101
+ <summary>Running from source instead (contributors)</summary>
102
+
103
+ If you cloned the repo rather than using the published package, point at your local `index.js`:
104
+
105
+ ```json
106
+ {
107
+ "mcpServers": {
108
+ "genudo": {
109
+ "command": "node",
110
+ "args": ["/absolute/path/to/genudo_mcp/index.js"],
111
+ "env": { "GENUDO_API_KEY": "your_api_key_here" }
112
+ }
113
+ }
114
+ }
115
+ ```
116
+
117
+ Replace the path with where you cloned the repo.
118
+ </details>
119
+
120
+ ### Step 3: Restart Claude Code
121
+
122
+ Exit your current Claude Code session and start a new one:
123
+
124
+ ```bash
125
+ # Exit current session
126
+ exit
127
+
128
+ # Start new session
129
+ claude
130
+ ```
131
+
132
+ ## Usage
133
+
134
+ Once configured, Claude Code will automatically have access to your Genudo tools. You can use them in your conversations:
135
+
136
+ **Example:**
137
+ ```
138
+ User: "Show me my account summary"
139
+ Claude: [Uses get_account_summary tool to fetch your data]
140
+
141
+ User: "Create a new sales pipeline using GPT-4"
142
+ Claude: [Uses get_pipeline_options and create_pipeline tools]
143
+ ```
144
+
145
+ ## Testing the Connection
146
+
147
+ You can test the bridge manually:
148
+
149
+ ```bash
150
+ # Set your API key
151
+ export GENUDO_API_KEY="your_api_key_here"
152
+
153
+ # Run the bridge
154
+ node index.js
155
+
156
+ # Send a test message (paste this and press Enter):
157
+ {"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}
158
+
159
+ # You should receive a response with server info
160
+ ```
161
+
162
+ ## Troubleshooting
163
+
164
+ ### "GENUDO_API_KEY environment variable is required"
165
+ - Make sure you've set the API key in your Claude Code config
166
+ - Verify the API key is valid in your Genudo account
167
+
168
+ ### "Timeout waiting for endpoint from SSE"
169
+ - Check that `GENUDO_BASE_URL` is correct (defaults to `https://api.genudo.ai`)
170
+ - Verify your server is running and accessible
171
+ - Check firewall/network settings
172
+
173
+ ### "HTTP 401: Unauthorized"
174
+ - Your API key is invalid or expired
175
+ - Generate a new API key in your Genudo account settings
176
+
177
+ ### Connection Issues with Self-Signed Certificates
178
+ - The bridge is configured to accept self-signed certificates for local development
179
+ - For production, use proper SSL certificates
180
+
181
+ ## Environment Variables
182
+
183
+ | Variable | Required | Default | Description |
184
+ |----------|----------|---------|-------------|
185
+ | `GENUDO_API_KEY` | **Yes** | - | Your Genudo API key from account settings |
186
+ | `GENUDO_BASE_URL` | No | `https://api.genudo.ai` | Base URL for self-hosted Genudo instances |
187
+ | `GENUDO_ALLOW_INSECURE_SSL` | No | `false` | Allow self-signed SSL certificates (local development only) |
188
+
189
+ ## Development
190
+
191
+ ### Project Structure
192
+ ```
193
+ genudo-mcp-client/
194
+ ├── index.js # Main bridge script
195
+ ├── package.json # Node.js project config
196
+ ├── .env.example # Environment variables template
197
+ └── README.md # This file
198
+ ```
199
+
200
+ ### How It Works
201
+
202
+ 1. Bridge connects to SSE endpoint to get the message POST URL
203
+ 2. Reads JSON-RPC requests from stdin (from Claude Code)
204
+ 3. Forwards requests as HTTP POST to the Genudo server
205
+ 4. Returns responses via stdout back to Claude Code
206
+
207
+ ```
208
+ Claude Code → (stdin) → Bridge → (HTTPS) → Genudo MCP Server
209
+ ↑ ↓
210
+ └─────── (stdout) ←────────────┘
211
+ ```
212
+
213
+ ## Security Notes
214
+
215
+ - **Never commit your API key** to version control
216
+ - Store API keys securely (environment variables, secrets manager)
217
+ - Rotate API keys regularly
218
+ - Use HTTPS in production
219
+ - Limit API key permissions to minimum required access
220
+
221
+ ## License
222
+
223
+ MIT
224
+
225
+ ## Support
226
+
227
+ Need help? We're here for you:
228
+
229
+ - 📖 [Documentation](https://docs.genudo.ai)
230
+ - 💬 [Community Forum](https://community.genudo.ai)
231
+ - 🐛 [Report an Issue](https://github.com/genudo-ai/genudo_mcp/issues)
232
+ - 📧 [Email Support](mailto:support@genudo.ai)
233
+
234
+ ## Contributing
235
+
236
+ We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to get started.
237
+
238
+ Quick overview:
239
+ 1. Fork the repository
240
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
241
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
242
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
243
+ 5. Open a Pull Request
244
+
245
+ ## Changelog
246
+
247
+ See the [GitHub Releases](https://github.com/genudo-ai/genudo_mcp/releases) page for changes and version history.
248
+
249
+ ## Related Projects
250
+
251
+ - [Genudo](https://genudo.ai) - The main Genudo automation platform
252
+ - [Model Context Protocol](https://modelcontextprotocol.io) - Learn more about MCP
253
+ - [Claude Code](https://code.claude.com) - The Claude AI coding assistant
package/index.js ADDED
@@ -0,0 +1,194 @@
1
+ #!/usr/bin/env node
2
+
3
+ const EventSource = require('eventsource');
4
+ const fetch = require('node-fetch');
5
+ const readline = require('readline');
6
+ const https = require('https');
7
+
8
+ // Configuration from environment variables
9
+ const BASE_URL = process.env.GENUDO_BASE_URL || 'https://api.genudo.ai';
10
+ const SSE_URL = `${BASE_URL}/api/user/mcp/sse`;
11
+ const API_KEY = process.env.GENUDO_API_KEY;
12
+ const ALLOW_INSECURE_SSL = process.env.GENUDO_ALLOW_INSECURE_SSL === 'true';
13
+
14
+ // HTTPS agent configuration
15
+ // For local development with self-signed certificates, set GENUDO_ALLOW_INSECURE_SSL=true
16
+ const httpsAgent = new https.Agent({
17
+ rejectUnauthorized: !ALLOW_INSECURE_SSL
18
+ });
19
+
20
+ // Validate configuration
21
+ if (!API_KEY) {
22
+ console.error('ERROR: GENUDO_API_KEY environment variable is required');
23
+ process.exit(1);
24
+ }
25
+
26
+ // Global state
27
+ let messageEndpoint = null;
28
+ let isInitialized = false;
29
+
30
+ /**
31
+ * Log debug messages to stderr (won't interfere with stdout JSON-RPC)
32
+ */
33
+ function debug(...args) {
34
+ console.error('[Genudo MCP Bridge]', ...args);
35
+ }
36
+
37
+ /**
38
+ * Connect to SSE endpoint to get the message endpoint URL
39
+ */
40
+ function connectSSE() {
41
+ return new Promise((resolve, reject) => {
42
+ debug('Connecting to SSE endpoint:', SSE_URL);
43
+
44
+ const eventSource = new EventSource(SSE_URL, {
45
+ headers: {
46
+ 'Api-Key': API_KEY
47
+ },
48
+ https: { rejectUnauthorized: !ALLOW_INSECURE_SSL }
49
+ });
50
+
51
+ eventSource.addEventListener('endpoint', (event) => {
52
+ messageEndpoint = event.data;
53
+ debug('Received message endpoint:', messageEndpoint);
54
+ isInitialized = true;
55
+ resolve(messageEndpoint);
56
+ });
57
+
58
+ eventSource.onerror = (error) => {
59
+ debug('SSE connection error:', error);
60
+ // Don't reject - SSE will auto-reconnect
61
+ };
62
+
63
+ // Timeout if no endpoint received within 10 seconds
64
+ setTimeout(() => {
65
+ if (!isInitialized) {
66
+ eventSource.close();
67
+ reject(new Error('Timeout waiting for endpoint from SSE'));
68
+ }
69
+ }, 10000);
70
+ });
71
+ }
72
+
73
+ /**
74
+ * Forward JSON-RPC request to the Laravel MCP server
75
+ */
76
+ async function forwardRequest(jsonRpcRequest) {
77
+ if (!messageEndpoint) {
78
+ throw new Error('Message endpoint not initialized');
79
+ }
80
+
81
+ debug('Forwarding request:', jsonRpcRequest.method, 'id:', jsonRpcRequest.id);
82
+
83
+ const response = await fetch(messageEndpoint, {
84
+ method: 'POST',
85
+ headers: {
86
+ 'Content-Type': 'application/json',
87
+ 'Api-Key': API_KEY
88
+ },
89
+ body: JSON.stringify(jsonRpcRequest),
90
+ agent: httpsAgent
91
+ });
92
+
93
+ if (!response.ok) {
94
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
95
+ }
96
+
97
+ // Handle 204 No Content (for notifications)
98
+ if (response.status === 204) {
99
+ return null;
100
+ }
101
+
102
+ return await response.json();
103
+ }
104
+
105
+ /**
106
+ * Process a single line of input (JSON-RPC request)
107
+ */
108
+ async function processInput(line) {
109
+ try {
110
+ const request = JSON.parse(line);
111
+ debug('Received request:', request.method);
112
+
113
+ const response = await forwardRequest(request);
114
+
115
+ // Only write response if there is one (notifications don't get responses)
116
+ if (response !== null) {
117
+ // Write response to stdout for Claude Code to read
118
+ console.log(JSON.stringify(response));
119
+ }
120
+ } catch (error) {
121
+ debug('Error processing request:', error.message);
122
+
123
+ // Try to extract ID from the line if possible
124
+ let id = null;
125
+ try {
126
+ const parsed = JSON.parse(line);
127
+ id = parsed.id;
128
+ } catch (e) {
129
+ // Ignore
130
+ }
131
+
132
+ // Send error response
133
+ const errorResponse = {
134
+ jsonrpc: '2.0',
135
+ id: id,
136
+ error: {
137
+ code: -32603,
138
+ message: error.message
139
+ }
140
+ };
141
+ console.log(JSON.stringify(errorResponse));
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Main function
147
+ */
148
+ async function main() {
149
+ try {
150
+ debug('Starting Genudo MCP Bridge...');
151
+
152
+ // Connect to SSE and get message endpoint
153
+ await connectSSE();
154
+ debug('Bridge initialized successfully');
155
+
156
+ // Set up readline to process stdin line by line
157
+ const rl = readline.createInterface({
158
+ input: process.stdin,
159
+ output: process.stdout,
160
+ terminal: false
161
+ });
162
+
163
+ // Process each line of input
164
+ rl.on('line', async (line) => {
165
+ if (line.trim()) {
166
+ await processInput(line);
167
+ }
168
+ });
169
+
170
+ // Handle EOF
171
+ rl.on('close', () => {
172
+ debug('Input stream closed, exiting...');
173
+ process.exit(0);
174
+ });
175
+
176
+ } catch (error) {
177
+ debug('Fatal error:', error.message);
178
+ process.exit(1);
179
+ }
180
+ }
181
+
182
+ // Handle graceful shutdown
183
+ process.on('SIGINT', () => {
184
+ debug('Received SIGINT, shutting down...');
185
+ process.exit(0);
186
+ });
187
+
188
+ process.on('SIGTERM', () => {
189
+ debug('Received SIGTERM, shutting down...');
190
+ process.exit(0);
191
+ });
192
+
193
+ // Start the bridge
194
+ main();
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "genudo-mcp-client",
3
+ "version": "1.0.0",
4
+ "description": "A lightweight bridge connecting Claude Code to Genudo's Model Context Protocol (MCP) server for AI-powered workflow automation",
5
+ "mcpName": "io.github.genudo-ai/genudo_mcp",
6
+ "main": "index.js",
7
+ "bin": {
8
+ "genudo-mcp-client": "index.js"
9
+ },
10
+ "scripts": {
11
+ "start": "node index.js",
12
+ "test": "echo \"Error: no test specified\" && exit 1"
13
+ },
14
+ "keywords": [
15
+ "mcp",
16
+ "model-context-protocol",
17
+ "claude",
18
+ "claude-code",
19
+ "genudo",
20
+ "ai",
21
+ "automation",
22
+ "bridge",
23
+ "stdio",
24
+ "sse",
25
+ "http"
26
+ ],
27
+ "author": {
28
+ "name": "Genudo",
29
+ "email": "support@genudo.ai",
30
+ "url": "https://genudo.ai"
31
+ },
32
+ "license": "MIT",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/genudo-ai/genudo_mcp.git"
36
+ },
37
+ "bugs": {
38
+ "url": "https://github.com/genudo-ai/genudo_mcp/issues",
39
+ "email": "support@genudo.ai"
40
+ },
41
+ "homepage": "https://github.com/genudo-ai/genudo_mcp#readme",
42
+ "dependencies": {
43
+ "eventsource": "^2.0.2",
44
+ "node-fetch": "^2.7.0"
45
+ },
46
+ "engines": {
47
+ "node": ">=18.0.0"
48
+ },
49
+ "publishConfig": {
50
+ "access": "public",
51
+ "provenance": true
52
+ },
53
+ "files": [
54
+ "index.js",
55
+ "README.md",
56
+ "LICENSE",
57
+ ".env.example"
58
+ ]
59
+ }