#!/usr/bin/env node
// 各種クライアント用の設定ファイル自動生成スクリプト
const configs = {
cursor: {
filename: '.cursor/mcp.json',
content: {
mcpServers: {
'gemini-url-context': {
command: 'npx',
args: ['@yourcompany/gemini-url-context-mcp@latest'],
env: { GEMINI_API_KEY: 'your-api-key-here' },
autoStart: true
}
}
}
},
claude_desktop: {
filename: 'claude_desktop_config.json',
content: {
mcpServers: {
'gemini-url-context': {
command: 'npx',
args: ['@yourcompany/gemini-url-context-mcp@latest'],
env: { GEMINI_API_KEY: 'your-api-key-here' }
}
}
}
},
vscode: {
filename: 'vscode_mcp_config.json',
content: {
name: 'gemini-url-context',
command: 'npx',
args: ['@yourcompany/gemini-url-context-mcp@latest'],
env: { GEMINI_API_KEY: 'your-api-key-here' }
}
}
};
const fs = require('fs');
const path = require('path');
function generateConfigs() {
console.log('🔧 設定ファイルを生成中...\n');
Object.entries(configs).forEach(([client, config]) => {
const configDir = path.dirname(config.filename);
// ディレクトリを作成
if (configDir !== '.') {
fs.mkdirSync(configDir, { recursive: true });
}
// 設定ファイルを書き込み
fs.writeFileSync(
config.filename,
JSON.stringify(config.content, null, 2)
);
console.log(`✅ ${client}: ${config.filename}`);
});
console.log('\n📝 使用方法:');
console.log('1. 各設定ファイルの "your-api-key-here" を実際のAPIキーに変更');
console.log('2. 各クライアントの設定ディレクトリにファイルをコピー');
console.log('\n🔗 Claude Code用ワンライナー:');
console.log('claude mcp add gemini-url-context -s user -e GEMINI_API_KEY="your-key" -- npx @yourcompany/gemini-url-context-mcp@latest');
}
generateConfigs();