@ameno/pi-minimax-mcp 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 ameno
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,207 @@
1
+ # @ameno/pi-minimax-mcp
2
+
3
+ MiniMax MCP tools for the Pi coding agent. Provides web_search and understand_image via the MiniMax MCP server.
4
+
5
+ [![Pi Extension](https://img.shields.io/badge/Pi-Extension-blue)](https://github.com/mariozechner/pi)
6
+ [![MiniMax MCP](https://img.shields.io/badge/MiniMax-MCP-green)](https://platform.minimax.io)
7
+
8
+ ## Highlights
9
+
10
+ - Web search for current information
11
+ - Image understanding for screenshots and photos
12
+ - Works as a Pi extension or standalone CLI
13
+ - Configurable via env vars, config file, or CLI flags
14
+
15
+ ## Install
16
+
17
+ ### Pi (recommended)
18
+
19
+ ```bash
20
+ pi install npm:@ameno/pi-minimax-mcp
21
+ ```
22
+
23
+ ### Standalone CLI
24
+
25
+ ```bash
26
+ npm install -g @ameno/pi-minimax-mcp
27
+ # or
28
+ pnpm add -g @ameno/pi-minimax-mcp
29
+ ```
30
+
31
+ ## Prerequisites
32
+
33
+ 1. MiniMax API key
34
+ - Subscribe at https://platform.minimax.io/subscribe/coding-plan
35
+ 2. uvx (required to run the MiniMax MCP server)
36
+ ```bash
37
+ curl -LsSf https://astral.sh/uv/install.sh | sh
38
+ ```
39
+
40
+ ## Quickstart
41
+
42
+ ```bash
43
+ export MINIMAX_API_KEY="your-api-key"
44
+
45
+ # In Pi
46
+ pi "Search the web for latest TypeScript releases"
47
+
48
+ # CLI
49
+ pi-minimax-mcp search "TypeScript release notes"
50
+ pi-minimax-mcp understand ./screenshot.png
51
+ ```
52
+
53
+ ## Configuration
54
+
55
+ ### Environment variables
56
+
57
+ ```bash
58
+ export MINIMAX_API_KEY="your-api-key"
59
+ export MINIMAX_API_HOST="https://api.minimax.io" # optional
60
+ export MINIMAX_MCP_BASE_PATH="/tmp/minimax" # optional
61
+ export MINIMAX_API_RESOURCE_MODE="url" # optional: url | local
62
+ ```
63
+
64
+ ### Config file
65
+
66
+ Create `~/.pi/agent/extensions/minimax-mcp.json`:
67
+
68
+ ```json
69
+ {
70
+ "apiKey": "your-api-key",
71
+ "apiHost": "https://api.minimax.io",
72
+ "basePath": "/tmp/minimax-output",
73
+ "resourceMode": "url",
74
+ "timeoutMs": 60000,
75
+ "maxBytes": 51200,
76
+ "maxLines": 2000
77
+ }
78
+ ```
79
+
80
+ Or project-specific `.pi/extensions/minimax-mcp.json`.
81
+
82
+ ## Usage
83
+
84
+ ### In Pi
85
+
86
+ ```
87
+ Search the web for "latest React server components"
88
+ What does this screenshot show? ./screenshot.png
89
+ ```
90
+
91
+ ### CLI
92
+
93
+ ```bash
94
+ # Web search
95
+ pi-minimax-mcp search "quantum computing breakthroughs"
96
+ pi-minimax-mcp search "Rust async patterns" --num-results 10
97
+
98
+ # Image analysis
99
+ pi-minimax-mcp understand ./error.png
100
+ pi-minimax-mcp understand ./chart.png --prompt "What trends?"
101
+
102
+ # Configuration
103
+ pi-minimax-mcp config
104
+ pi-minimax-mcp init
105
+ ```
106
+
107
+ ### Programmatic
108
+
109
+ ```typescript
110
+ import { MiniMaxMcpClient } from "@ameno/pi-minimax-mcp";
111
+
112
+ const client = new MiniMaxMcpClient({
113
+ apiKey: process.env.MINIMAX_API_KEY!,
114
+ });
115
+
116
+ // Web search
117
+ const searchResults = await client.webSearch({
118
+ query: "TypeScript 5.5 features",
119
+ numResults: 5,
120
+ });
121
+
122
+ // Image understanding
123
+ const imageAnalysis = await client.understandImage({
124
+ imagePath: "./diagram.png",
125
+ prompt: "Explain this architecture",
126
+ });
127
+
128
+ client.disconnect();
129
+ ```
130
+
131
+ ## Pi Extension Flags
132
+
133
+ ```bash
134
+ pi --minimax-api-key=<key> --minimax-api-host=<host>
135
+ ```
136
+
137
+ | Flag | Description |
138
+ |------|-------------|
139
+ | `--minimax-api-key` | Override API key |
140
+ | `--minimax-api-host` | Override API host |
141
+ | `--minimax-mcp-config` | Custom config file path |
142
+ | `--minimax-mcp-max-bytes` | Max output bytes |
143
+ | `--minimax-mcp-max-lines` | Max output lines |
144
+
145
+ ## Architecture
146
+
147
+ ```
148
+ ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
149
+ │ Pi Agent │────▶│ pi-minimax-mcp │────▶│ uvx minimax- │
150
+ │ Extension │◄────│ Extension │◄────│ coding-plan-mcp│
151
+ └─────────────────┘ └──────────────────┘ └─────────────────┘
152
+
153
+
154
+ ┌─────────┐
155
+ │ MiniMax │
156
+ │ API │
157
+ └─────────┘
158
+ ```
159
+
160
+ ## Tools Reference
161
+
162
+ ### web_search
163
+
164
+ Search the web for current information.
165
+
166
+ Parameters:
167
+ - `query` (string, required): Search query
168
+ - `numResults` (number, optional): Results to return (1-10, default: 5)
169
+ - `recencyDays` (number, optional): Limit to recent days
170
+
171
+ ### understand_image
172
+
173
+ Analyze image content.
174
+
175
+ Parameters:
176
+ - `imagePath` (string, required): Path to image file
177
+ - `prompt` (string, optional): Guiding question/prompt
178
+
179
+ ## Development
180
+
181
+ ```bash
182
+ # Clone
183
+ git clone https://github.com/ameno-/pi-minimax-mcp.git
184
+ cd pi-minimax-mcp
185
+
186
+ # Install dependencies
187
+ pnpm install
188
+
189
+ # Build
190
+ pnpm run build
191
+
192
+ # Test
193
+ pnpm test
194
+ ```
195
+
196
+ ## Tags
197
+
198
+ pi-package, pi-extension, pi-coding-agent, mcp, minimax, web-search, image-understanding
199
+
200
+ ## License
201
+
202
+ MIT
203
+
204
+ ## Acknowledgments
205
+
206
+ - Inspired by @benvargas/pi-exa-mcp
207
+ - Powered by MiniMax
@@ -0,0 +1,163 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * pi-minimax-mcp CLI
4
+ *
5
+ * Command-line interface for MiniMax MCP tools
6
+ *
7
+ * Usage:
8
+ * pi-minimax-mcp search "quantum computing latest"
9
+ * pi-minimax-mcp understand ./screenshot.png
10
+ * pi-minimax-mcp config # Show current config
11
+ * pi-minimax-mcp init # Create default config
12
+ */
13
+
14
+ import { MiniMaxMcpClient } from "../dist/client.js";
15
+ import { loadConfig, mergeConfig, validateConfig, ensureDefaultConfig } from "../dist/config.js";
16
+ import { formatToolOutput } from "../dist/utils.js";
17
+
18
+ const USAGE = `
19
+ Usage: pi-minimax-mcp <command> [options]
20
+
21
+ Commands:
22
+ search <query> Perform web search
23
+ understand <path> Analyze image
24
+ config Show current configuration
25
+ init Create default config file
26
+ --help, -h Show this help
27
+ --version, -v Show version
28
+
29
+ Environment Variables:
30
+ MINIMAX_API_KEY Required. Get from https://platform.minimax.io/subscribe/coding-plan
31
+ MINIMAX_API_HOST Optional. Default: https://api.minimax.io
32
+ MINIMAX_MCP_BASE_PATH Optional. Local output directory
33
+ MINIMAX_API_RESOURCE_MODE Optional. "url" or "local"
34
+
35
+ Examples:
36
+ pi-minimax-mcp search "Rust async/await patterns"
37
+ pi-minimax-mcp search "OpenAI GPT-5 rumors" --num-results 10
38
+ pi-minimax-mcp understand ./error-screenshot.png
39
+ pi-minimax-mcp understand ./chart.png --prompt "What trends does this show?"
40
+ `;
41
+
42
+ function parseArgs() {
43
+ const args = process.argv.slice(2);
44
+ const command = args[0];
45
+ const options = {};
46
+ const positional = [];
47
+
48
+ for (let i = 1; i < args.length; i++) {
49
+ const arg = args[i];
50
+ if (arg.startsWith("--")) {
51
+ const key = arg.slice(2).replace(/-/g, "");
52
+ const value = args[i + 1] && !args[i + 1].startsWith("--") ? args[++i] : "true";
53
+ options[key] = value;
54
+ } else {
55
+ positional.push(arg);
56
+ }
57
+ }
58
+
59
+ return { command, options, positional };
60
+ }
61
+
62
+ async function main() {
63
+ const { command, options, positional } = parseArgs();
64
+
65
+ if (!command || command === "--help" || command === "-h") {
66
+ console.log(USAGE);
67
+ process.exit(0);
68
+ }
69
+
70
+ if (command === "--version" || command === "-v") {
71
+ console.log("1.0.0");
72
+ process.exit(0);
73
+ }
74
+
75
+ if (command === "init") {
76
+ ensureDefaultConfig();
77
+ process.exit(0);
78
+ }
79
+
80
+ if (command === "config") {
81
+ const config = loadConfig(options.config);
82
+ console.log("Current configuration:");
83
+ console.log(JSON.stringify({ ...config, apiKey: config.apiKey ? "***REDACTED***" : undefined }, null, 2));
84
+ process.exit(0);
85
+ }
86
+
87
+ // Validate we have an API key before proceeding
88
+ const config = mergeConfig({});
89
+ try {
90
+ validateConfig(config);
91
+ } catch (err) {
92
+ console.error(err instanceof Error ? err.message : "Configuration error");
93
+ process.exit(1);
94
+ }
95
+
96
+ const client = new MiniMaxMcpClient(config);
97
+
98
+ try {
99
+ if (command === "search") {
100
+ const query = positional[0] || options.query;
101
+ if (!query) {
102
+ console.error("Error: Search query required");
103
+ console.log("\nUsage: pi-minimax-mcp search <query> [--num-results N]");
104
+ process.exit(1);
105
+ }
106
+
107
+ console.log(`Searching: "${query}"...\n`);
108
+
109
+ const result = await client.webSearch({
110
+ query,
111
+ numResults: parseInt(options.numresults || options.numResults, 10) || undefined,
112
+ recencyDays: parseInt(options.recencydays || options.recencyDays, 10) || undefined,
113
+ });
114
+
115
+ const formatted = formatToolOutput(result, {
116
+ maxBytes: config.maxBytes,
117
+ maxLines: config.maxLines,
118
+ });
119
+
120
+ console.log(formatted.text);
121
+
122
+ if (formatted.details.truncated && formatted.details.tempFile) {
123
+ console.log(`\n[Full output saved to: ${formatted.details.tempFile}]`);
124
+ }
125
+ } else if (command === "understand" || command === "image") {
126
+ const imagePath = positional[0] || options.image || options.path;
127
+ if (!imagePath) {
128
+ console.error("Error: Image path required");
129
+ console.log("\nUsage: pi-minimax-mcp understand <image-path> [--prompt \"question\"]");
130
+ process.exit(1);
131
+ }
132
+
133
+ console.log(`Analyzing: ${imagePath}...\n`);
134
+
135
+ const result = await client.understandImage({
136
+ imagePath,
137
+ prompt: options.prompt,
138
+ });
139
+
140
+ const formatted = formatToolOutput(result, {
141
+ maxBytes: config.maxBytes,
142
+ maxLines: config.maxLines,
143
+ });
144
+
145
+ console.log(formatted.text);
146
+
147
+ if (formatted.details.truncated && formatted.details.tempFile) {
148
+ console.log(`\n[Full output saved to: ${formatted.details.tempFile}]`);
149
+ }
150
+ } else {
151
+ console.error(`Unknown command: ${command}`);
152
+ console.log(USAGE);
153
+ process.exit(1);
154
+ }
155
+ } catch (error) {
156
+ console.error(error instanceof Error ? error.message : String(error));
157
+ process.exit(1);
158
+ } finally {
159
+ client.disconnect();
160
+ }
161
+ }
162
+
163
+ main();
@@ -0,0 +1,30 @@
1
+ /**
2
+ * MiniMax MCP Client
3
+ *
4
+ * Manages the MCP connection to MiniMax via stdio (uvx minimax-coding-plan-mcp)
5
+ */
6
+ import type { McpToolResult, MiniMaxMcpConfig, UnderstandImageParams, WebSearchParams } from "./types.js";
7
+ export declare class MiniMaxMcpClient {
8
+ private readonly config;
9
+ private process;
10
+ private requestId;
11
+ private pendingRequests;
12
+ private buffer;
13
+ private initialized;
14
+ private initPromise;
15
+ constructor(config: MiniMaxMcpConfig);
16
+ connect(): Promise<void>;
17
+ private doConnect;
18
+ private initialize;
19
+ private handleData;
20
+ private handleMessage;
21
+ private handleProcessError;
22
+ private cleanup;
23
+ private sendRequest;
24
+ private sendNotification;
25
+ callTool(name: string, args: Record<string, unknown>): Promise<McpToolResult>;
26
+ webSearch(params: WebSearchParams): Promise<McpToolResult>;
27
+ understandImage(params: UnderstandImageParams): Promise<McpToolResult>;
28
+ disconnect(): void;
29
+ }
30
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAGV,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EAChB,MAAM,YAAY,CAAC;AAQpB,qBAAa,gBAAgB;IAQf,OAAO,CAAC,QAAQ,CAAC,MAAM;IAPnC,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,eAAe,CAA8C;IACrE,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,WAAW,CAA8B;gBAEpB,MAAM,EAAE,gBAAgB;IAE/C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;YAQhB,SAAS;YA+CT,UAAU;IAkBxB,OAAO,CAAC,UAAU;IAoBlB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,OAAO;YASD,WAAW;YA+BX,gBAAgB;IAcxB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAe7E,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC;IAQ1D,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC;IAO5E,UAAU,IAAI,IAAI;CAGnB"}
package/dist/client.js ADDED
@@ -0,0 +1,189 @@
1
+ /**
2
+ * MiniMax MCP Client
3
+ *
4
+ * Manages the MCP connection to MiniMax via stdio (uvx minimax-coding-plan-mcp)
5
+ */
6
+ import { spawn } from "node:child_process";
7
+ export class MiniMaxMcpClient {
8
+ config;
9
+ process = null;
10
+ requestId = 0;
11
+ pendingRequests = new Map();
12
+ buffer = "";
13
+ initialized = false;
14
+ initPromise = null;
15
+ constructor(config) {
16
+ this.config = config;
17
+ }
18
+ async connect() {
19
+ if (this.initialized)
20
+ return;
21
+ if (this.initPromise)
22
+ return this.initPromise;
23
+ this.initPromise = this.doConnect();
24
+ return this.initPromise;
25
+ }
26
+ async doConnect() {
27
+ const env = {
28
+ ...process.env,
29
+ MINIMAX_API_KEY: this.config.apiKey,
30
+ MINIMAX_API_HOST: this.config.apiHost,
31
+ ...(this.config.basePath && { MINIMAX_MCP_BASE_PATH: this.config.basePath }),
32
+ ...(this.config.resourceMode && { MINIMAX_API_RESOURCE_MODE: this.config.resourceMode }),
33
+ };
34
+ this.process = spawn("uvx", ["minimax-coding-plan-mcp", "-y"], {
35
+ env,
36
+ stdio: ["pipe", "pipe", "pipe"],
37
+ });
38
+ this.process.stdout?.on("data", (data) => this.handleData(data));
39
+ this.process.stderr?.on("data", (data) => {
40
+ const msg = data.toString();
41
+ if (msg.includes("error") || msg.includes("Error")) {
42
+ console.error(`[pi-minimax-mcp] ${msg.trim()}`);
43
+ }
44
+ });
45
+ this.process.on("error", (err) => this.handleProcessError(err));
46
+ this.process.on("exit", (code) => {
47
+ if (code !== 0 && code !== null) {
48
+ console.error(`[pi-minimax-mcp] Process exited with code ${code}`);
49
+ }
50
+ this.cleanup();
51
+ });
52
+ // Wait for process to be ready
53
+ await new Promise((resolve, reject) => {
54
+ const timeout = setTimeout(() => reject(new Error("MCP process startup timeout")), 10000);
55
+ const checkReady = setInterval(() => {
56
+ if (this.process?.pid) {
57
+ clearTimeout(timeout);
58
+ clearInterval(checkReady);
59
+ resolve();
60
+ }
61
+ }, 100);
62
+ });
63
+ // Initialize MCP protocol
64
+ await this.initialize();
65
+ this.initialized = true;
66
+ }
67
+ async initialize() {
68
+ const response = await this.sendRequest("initialize", {
69
+ protocolVersion: "2024-11-05",
70
+ capabilities: {},
71
+ clientInfo: {
72
+ name: "pi-minimax-mcp",
73
+ version: "1.0.0",
74
+ },
75
+ });
76
+ if (response.error) {
77
+ throw new Error(`MCP initialize failed: ${response.error.message}`);
78
+ }
79
+ // Send initialized notification
80
+ await this.sendNotification("notifications/initialized", {});
81
+ }
82
+ handleData(data) {
83
+ this.buffer += data.toString();
84
+ let newlineIndex;
85
+ while ((newlineIndex = this.buffer.indexOf("\n")) !== -1) {
86
+ const line = this.buffer.slice(0, newlineIndex).trim();
87
+ this.buffer = this.buffer.slice(newlineIndex + 1);
88
+ if (!line)
89
+ continue;
90
+ try {
91
+ const message = JSON.parse(line);
92
+ this.handleMessage(message);
93
+ }
94
+ catch {
95
+ // Not JSON, might be logging
96
+ console.log(`[pi-minimax-mcp] ${line}`);
97
+ }
98
+ }
99
+ }
100
+ handleMessage(message) {
101
+ if (message.id != null && this.pendingRequests.has(message.id)) {
102
+ const request = this.pendingRequests.get(message.id);
103
+ this.pendingRequests.delete(message.id);
104
+ clearTimeout(request.timer);
105
+ request.resolve(message);
106
+ }
107
+ }
108
+ handleProcessError(err) {
109
+ for (const [, request] of this.pendingRequests) {
110
+ request.reject(err);
111
+ }
112
+ this.pendingRequests.clear();
113
+ this.cleanup();
114
+ }
115
+ cleanup() {
116
+ this.initialized = false;
117
+ this.initPromise = null;
118
+ if (this.process) {
119
+ this.process.kill();
120
+ this.process = null;
121
+ }
122
+ }
123
+ async sendRequest(method, params) {
124
+ if (!this.process?.stdin) {
125
+ throw new Error("MCP process not connected");
126
+ }
127
+ const id = ++this.requestId;
128
+ const request = {
129
+ jsonrpc: "2.0",
130
+ id,
131
+ method,
132
+ params,
133
+ };
134
+ return new Promise((resolve, reject) => {
135
+ const timer = setTimeout(() => {
136
+ this.pendingRequests.delete(id);
137
+ reject(new Error(`MCP request timeout after ${this.config.timeoutMs}ms`));
138
+ }, this.config.timeoutMs);
139
+ this.pendingRequests.set(id, { resolve, reject, timer });
140
+ try {
141
+ this.process.stdin.write(JSON.stringify(request) + "\n");
142
+ }
143
+ catch (err) {
144
+ this.pendingRequests.delete(id);
145
+ clearTimeout(timer);
146
+ reject(err);
147
+ }
148
+ });
149
+ }
150
+ async sendNotification(method, params) {
151
+ if (!this.process?.stdin) {
152
+ throw new Error("MCP process not connected");
153
+ }
154
+ const notification = {
155
+ jsonrpc: "2.0",
156
+ method,
157
+ params,
158
+ };
159
+ this.process.stdin.write(JSON.stringify(notification) + "\n");
160
+ }
161
+ async callTool(name, args) {
162
+ await this.connect();
163
+ const response = await this.sendRequest("tools/call", {
164
+ name,
165
+ arguments: args,
166
+ });
167
+ if (response.error) {
168
+ throw new Error(`Tool call failed: ${response.error.message}`);
169
+ }
170
+ return response.result ?? { content: [] };
171
+ }
172
+ async webSearch(params) {
173
+ return this.callTool("web_search", {
174
+ query: params.query,
175
+ ...(params.numResults && { num_results: params.numResults }),
176
+ ...(params.recencyDays && { recency_days: params.recencyDays }),
177
+ });
178
+ }
179
+ async understandImage(params) {
180
+ return this.callTool("understand_image", {
181
+ image_source: params.imagePath,
182
+ prompt: params.prompt || "Describe this image in detail",
183
+ });
184
+ }
185
+ disconnect() {
186
+ this.cleanup();
187
+ }
188
+ }
189
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAmB9D,MAAM,OAAO,gBAAgB;IAQ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+ /**
2
+ * MiniMax MCP Configuration
3
+ *
4
+ * Handles configuration loading from files and environment variables
5
+ */
6
+ import { type MiniMaxMcpConfig } from "./types.js";
7
+ export declare function resolveConfigPath(customPath?: string): string | null;
8
+ export declare function loadConfig(customPath?: string): MiniMaxMcpConfig;
9
+ export declare function mergeConfig(overrides: Partial<MiniMaxMcpConfig>): MiniMaxMcpConfig;
10
+ export declare function ensureDefaultConfig(): void;
11
+ export declare function validateConfig(config: MiniMaxMcpConfig): void;
12
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAOnE,wBAAgB,iBAAiB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOpE;AAED,wBAAgB,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAkBhE;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAgBlF;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CA2B1C;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAO7D"}