Skip to content

Commit 5920f7b

Browse files
authored
Remove type in MCP configs (#24)
1 parent 8592c91 commit 5920f7b

File tree

4 files changed

+3
-15
lines changed

4 files changed

+3
-15
lines changed

src/install.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ export const buildMcpConfig = (options: {
128128
const packageName = NPX_PACKAGE_NAME + (options.autoUpdate ? "@latest" : "");
129129

130130
return {
131-
type: "stdio" as const,
132131
command: isLocal ? nodePath : npxPath,
133132
args: isLocal
134133
? [path.resolve(process.cwd(), "dist", "index.js")]
@@ -690,11 +689,10 @@ export const setupMcpServer = async (): Promise<void> => {
690689
showSection("Manual Configuration", icons.rocket);
691690
console.log();
692691

693-
const { type, command, args, env } = iterableMcpConfig;
692+
const { command, args, env } = iterableMcpConfig;
694693

695694
showInfo("Add the MCP server to your AI tool with these settings:");
696695
console.log();
697-
console.log(chalk.white.bold(" Type:") + ` ${type}`);
698696
console.log(chalk.white.bold(" Command:") + ` ${command}`);
699697
console.log(chalk.white.bold(" Args:") + ` ${args.join(" ")}`);
700698
const envEntries = Object.entries(env);

src/utils/tool-config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export function getClaudeDesktopConfigPath(): string {
4040
}
4141

4242
export type IterableMcpConfig = {
43-
type: "stdio";
4443
command: string;
4544
args: string[];
4645
env: Record<string, string>;

tests/unit/install.test.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ describe("MCP Server Setup Configuration", () => {
5858
describe("MCP Config JSON Structure", () => {
5959
it("should have required stdio config fields", () => {
6060
const mcpConfig = {
61-
type: "stdio" as const,
6261
command: "/path/to/node",
6362
args: ["-y", "@iterable/mcp"],
6463
env: {
@@ -68,7 +67,6 @@ describe("MCP Server Setup Configuration", () => {
6867
},
6968
};
7069

71-
expect(mcpConfig.type).toBe("stdio");
7270
expect(mcpConfig.command).toBeTruthy();
7371
expect(Array.isArray(mcpConfig.args)).toBe(true);
7472
// API keys are stored via KeyManager, not in config env
@@ -126,7 +124,6 @@ describe("MCP Server Setup Configuration", () => {
126124
mcpServers: {
127125
...existingConfig.mcpServers,
128126
iterable: {
129-
type: "stdio" as const,
130127
command: "node",
131128
args: [],
132129
env: {},
@@ -155,7 +152,6 @@ describe("MCP Server Setup Configuration", () => {
155152
mcpServers: {
156153
...existingConfig.mcpServers,
157154
iterable: {
158-
type: "stdio" as const,
159155
command: "new-command",
160156
args: ["new-arg"],
161157
env: { NEW_KEY: "new-value" },
@@ -173,7 +169,6 @@ describe("MCP Server Setup Configuration", () => {
173169
describe("Claude Code JSON Command", () => {
174170
it("should generate valid JSON for claude mcp add-json", () => {
175171
const mcpConfig = {
176-
type: "stdio" as const,
177172
command: "npx",
178173
args: ["-y", "@iterable/mcp"],
179174
env: {
@@ -185,15 +180,13 @@ describe("MCP Server Setup Configuration", () => {
185180
const jsonString = JSON.stringify(mcpConfig);
186181
const parsed = JSON.parse(jsonString);
187182

188-
expect(parsed.type).toBe("stdio");
189183
expect(parsed.command).toBe("npx");
190184
expect(parsed.args).toEqual(["-y", "@iterable/mcp"]);
191185
expect(parsed.env).toHaveProperty("ITERABLE_USER_PII");
192186
});
193187

194188
it("should escape special characters in JSON", () => {
195189
const configWithSpecialChars = {
196-
type: "stdio" as const,
197190
command: "node",
198191
args: ["/path/to/file"],
199192
env: {
@@ -217,7 +210,6 @@ describe("MCP Server Setup Configuration", () => {
217210
describe("Configuration Consistency", () => {
218211
it("should generate same config structure for all tools", () => {
219212
const baseConfig = {
220-
type: "stdio" as const,
221213
command: "npx",
222214
args: ["-y", "@iterable/mcp"],
223215
env: {
@@ -360,7 +352,8 @@ describe("MCP Server Setup Configuration", () => {
360352
env: mockEnv,
361353
});
362354

363-
expect(config).toHaveProperty("type", "stdio");
355+
// Note: type field is omitted for compatibility with Gemini CLI and others
356+
expect(config).not.toHaveProperty("type");
364357
expect(config).toHaveProperty("command");
365358
expect(config).toHaveProperty("args");
366359
expect(config).toHaveProperty("env");
@@ -392,7 +385,6 @@ describe("MCP Server Setup Configuration", () => {
392385

393386
// Should be parseable
394387
const parsed = JSON.parse(json);
395-
expect(parsed.type).toBe("stdio");
396388
expect(parsed.command).toBe(config.command);
397389
expect(parsed.args).toEqual(config.args);
398390
expect(parsed.env).toEqual(config.env);

tests/unit/tool-config-secure-write.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ describe("tool-config secure writes", () => {
1313
const filePath = path.join(tmpDir, "config.json");
1414

1515
const iterableConfig = {
16-
type: "stdio" as const,
1716
command: "node",
1817
args: ["/dev/null"],
1918
env: { ITERABLE_USER_PII: "false" },

0 commit comments

Comments
 (0)