claude-autopm 1.14.1 ā 1.15.1
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/autopm/.claude/agents/cloud/aws-cloud-architect.md +3 -3
- package/autopm/.claude/agents/cloud/azure-cloud-architect.md +3 -3
- package/autopm/.claude/agents/cloud/gcp-cloud-architect.md +3 -3
- package/autopm/.claude/agents/cloud/gcp-cloud-functions-engineer.md +4 -4
- package/autopm/.claude/agents/cloud/gemini-api-expert.md +3 -3
- package/autopm/.claude/agents/cloud/kubernetes-orchestrator.md +3 -3
- package/autopm/.claude/agents/cloud/openai-python-expert.md +3 -3
- package/autopm/.claude/agents/cloud/terraform-infrastructure-expert.md +4 -4
- package/autopm/.claude/agents/core/agent-manager.md +4 -4
- package/autopm/.claude/agents/core/code-analyzer.md +4 -4
- package/autopm/.claude/agents/core/file-analyzer.md +4 -4
- package/autopm/.claude/agents/core/mcp-manager.md +2 -2
- package/autopm/.claude/agents/core/parallel-worker.md +4 -4
- package/autopm/.claude/agents/core/test-runner.md +4 -4
- package/autopm/.claude/agents/data/airflow-orchestration-expert.md +3 -3
- package/autopm/.claude/agents/data/kedro-pipeline-expert.md +2 -2
- package/autopm/.claude/agents/data/langgraph-workflow-expert.md +3 -3
- package/autopm/.claude/agents/databases/bigquery-expert.md +4 -4
- package/autopm/.claude/agents/databases/cosmosdb-expert.md +4 -4
- package/autopm/.claude/agents/databases/mongodb-expert.md +4 -4
- package/autopm/.claude/agents/databases/postgresql-expert.md +4 -4
- package/autopm/.claude/agents/databases/redis-expert.md +3 -3
- package/autopm/.claude/agents/devops/azure-devops-specialist.md +3 -3
- package/autopm/.claude/agents/devops/docker-containerization-expert.md +4 -4
- package/autopm/.claude/agents/devops/observability-engineer.md +4 -4
- package/autopm/.claude/agents/devops/ssh-operations-expert.md +3 -3
- package/autopm/.claude/agents/devops/traefik-proxy-expert.md +3 -3
- package/autopm/.claude/agents/frameworks/e2e-test-engineer.md +4 -4
- package/autopm/.claude/agents/frameworks/nats-messaging-expert.md +2 -2
- package/autopm/.claude/agents/frameworks/react-frontend-engineer.md +3 -3
- package/autopm/.claude/agents/frameworks/react-ui-expert.md +4 -4
- package/autopm/.claude/agents/frameworks/tailwindcss-expert.md +4 -4
- package/autopm/.claude/agents/frameworks/ux-design-expert.md +4 -4
- package/autopm/.claude/agents/integration/message-queue-engineer.md +4 -4
- package/autopm/.claude/agents/languages/bash-scripting-expert.md +4 -4
- package/autopm/.claude/agents/languages/javascript-frontend-engineer.md +4 -4
- package/autopm/.claude/agents/languages/nodejs-backend-engineer.md +4 -4
- package/autopm/.claude/agents/languages/python-backend-engineer.md +3 -3
- package/autopm/.claude/agents/languages/python-backend-expert.md +4 -4
- package/autopm/.claude/agents/testing/frontend-testing-engineer.md +4 -4
- package/autopm/.claude/examples/mcp/README.md +11 -15
- package/autopm/.claude/examples/mcp/context7.md +205 -0
- package/autopm/.claude/examples/mcp-servers.example.json +9 -9
- package/autopm/.claude/mcp/MCP-REGISTRY.md +10 -10
- package/autopm/.claude/rules/agent-coordination.md +5 -5
- package/bin/commands/mcp.js +59 -0
- package/package.json +1 -1
- package/scripts/mcp-handler.js +343 -0
- package/autopm/.claude/examples/mcp/context7-codebase.md +0 -267
- package/autopm/.claude/examples/mcp/context7-docs.md +0 -190
package/scripts/mcp-handler.js
CHANGED
|
@@ -555,6 +555,349 @@ This server can be integrated with various agents and context pools.
|
|
|
555
555
|
console.log(`š TODO: Remove ${name} from registry`);
|
|
556
556
|
}
|
|
557
557
|
|
|
558
|
+
// ==========================================
|
|
559
|
+
// DISCOVERY & INSTALLATION
|
|
560
|
+
// ==========================================
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Search npm registry for MCP servers
|
|
564
|
+
* @param {string} query - Search query
|
|
565
|
+
* @param {Object} options - Search options
|
|
566
|
+
*/
|
|
567
|
+
async search(query, options = {}) {
|
|
568
|
+
console.log(`š Searching npm for "${query}"...\n`);
|
|
569
|
+
|
|
570
|
+
try {
|
|
571
|
+
const { execSync } = require('child_process');
|
|
572
|
+
|
|
573
|
+
// Build npm search command
|
|
574
|
+
let searchQuery = query;
|
|
575
|
+
if (options.official) {
|
|
576
|
+
searchQuery = `@modelcontextprotocol ${query}`;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
// Search npm
|
|
580
|
+
const searchResults = execSync(`npm search ${searchQuery} --json`, {
|
|
581
|
+
encoding: 'utf8',
|
|
582
|
+
stdio: ['pipe', 'pipe', 'ignore']
|
|
583
|
+
});
|
|
584
|
+
|
|
585
|
+
const packages = JSON.parse(searchResults);
|
|
586
|
+
|
|
587
|
+
// Filter for MCP-related packages
|
|
588
|
+
const mcpPackages = packages.filter(pkg => {
|
|
589
|
+
const name = pkg.name.toLowerCase();
|
|
590
|
+
const desc = (pkg.description || '').toLowerCase();
|
|
591
|
+
return name.includes('mcp') || name.includes('context') ||
|
|
592
|
+
desc.includes('mcp') || desc.includes('model context protocol');
|
|
593
|
+
});
|
|
594
|
+
|
|
595
|
+
if (mcpPackages.length === 0) {
|
|
596
|
+
console.log('ā No MCP servers found matching your query');
|
|
597
|
+
console.log('\nš” Try:');
|
|
598
|
+
console.log(' - Broader search terms');
|
|
599
|
+
console.log(' - Use --official to search @modelcontextprotocol packages');
|
|
600
|
+
console.log(' - Visit: https://www.npmjs.com/search?q=@modelcontextprotocol');
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
console.log(`š¦ Found ${mcpPackages.length} MCP server(s):\n`);
|
|
605
|
+
|
|
606
|
+
mcpPackages.forEach((pkg, index) => {
|
|
607
|
+
console.log(`${index + 1}. ${pkg.name}`);
|
|
608
|
+
console.log(` Version: ${pkg.version}`);
|
|
609
|
+
if (pkg.description) {
|
|
610
|
+
console.log(` Description: ${pkg.description}`);
|
|
611
|
+
}
|
|
612
|
+
console.log(` Downloads: ${this._formatDownloads(pkg)}`);
|
|
613
|
+
console.log();
|
|
614
|
+
});
|
|
615
|
+
|
|
616
|
+
console.log('š” To install a server:');
|
|
617
|
+
console.log(` autopm mcp install <package-name>`);
|
|
618
|
+
console.log('\nš More info: https://registry.modelcontextprotocol.io');
|
|
619
|
+
|
|
620
|
+
} catch (error) {
|
|
621
|
+
console.error('ā Search failed:', error.message);
|
|
622
|
+
console.log('\nš” Try using npm directly: npm search mcp');
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Browse popular/official MCP servers
|
|
628
|
+
* @param {Object} options - Browse options
|
|
629
|
+
*/
|
|
630
|
+
async browse(options = {}) {
|
|
631
|
+
console.log('š Popular MCP Servers\n');
|
|
632
|
+
|
|
633
|
+
const officialServers = [
|
|
634
|
+
{
|
|
635
|
+
name: '@modelcontextprotocol/server-filesystem',
|
|
636
|
+
description: 'MCP server for filesystem access',
|
|
637
|
+
category: 'codebase'
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
name: '@modelcontextprotocol/server-memory',
|
|
641
|
+
description: 'Knowledge graph memory for Claude',
|
|
642
|
+
category: 'database'
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
name: '@modelcontextprotocol/server-sequential-thinking',
|
|
646
|
+
description: 'Structured problem-solving server',
|
|
647
|
+
category: 'utility'
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
name: '@upstash/context7-mcp',
|
|
651
|
+
description: 'Context7 documentation and codebase server',
|
|
652
|
+
category: 'documentation'
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
name: '@playwright/mcp',
|
|
656
|
+
description: 'Browser automation and E2E testing',
|
|
657
|
+
category: 'testing'
|
|
658
|
+
}
|
|
659
|
+
];
|
|
660
|
+
|
|
661
|
+
let servers = options.official ? officialServers.filter(s => s.name.startsWith('@modelcontextprotocol')) : officialServers;
|
|
662
|
+
|
|
663
|
+
if (options.category) {
|
|
664
|
+
servers = servers.filter(s => s.category === options.category);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
if (servers.length === 0) {
|
|
668
|
+
console.log('ā No servers found matching your filters');
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
servers.forEach((server, index) => {
|
|
673
|
+
console.log(`${index + 1}. ${server.name}`);
|
|
674
|
+
console.log(` Category: ${server.category}`);
|
|
675
|
+
console.log(` Description: ${server.description}`);
|
|
676
|
+
console.log();
|
|
677
|
+
});
|
|
678
|
+
|
|
679
|
+
console.log('š” To install a server:');
|
|
680
|
+
console.log(' autopm mcp install <package-name> --enable');
|
|
681
|
+
console.log('\nš” To search for more:');
|
|
682
|
+
console.log(' autopm mcp search <query>');
|
|
683
|
+
console.log('\nš Full registry: https://registry.modelcontextprotocol.io');
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Install MCP server from npm
|
|
688
|
+
* @param {string} packageName - NPM package name
|
|
689
|
+
* @param {Object} options - Installation options
|
|
690
|
+
*/
|
|
691
|
+
async installFromNpm(packageName, options = {}) {
|
|
692
|
+
console.log(`š¦ Installing MCP server: ${packageName}\n`);
|
|
693
|
+
|
|
694
|
+
try {
|
|
695
|
+
const { execSync } = require('child_process');
|
|
696
|
+
|
|
697
|
+
// Step 1: Fetch package info
|
|
698
|
+
console.log('1ļøā£ Fetching package info from npm...');
|
|
699
|
+
const packageInfo = execSync(`npm view ${packageName} --json`, {
|
|
700
|
+
encoding: 'utf8'
|
|
701
|
+
});
|
|
702
|
+
const pkg = JSON.parse(packageInfo);
|
|
703
|
+
console.log(` ā
Found: ${pkg.name}@${pkg.version}`);
|
|
704
|
+
|
|
705
|
+
// Step 2: Install npm package
|
|
706
|
+
console.log('\n2ļøā£ Installing npm package...');
|
|
707
|
+
execSync(`npm install -g ${packageName}`, {
|
|
708
|
+
encoding: 'utf8',
|
|
709
|
+
stdio: 'inherit'
|
|
710
|
+
});
|
|
711
|
+
console.log(' ā
Installed successfully');
|
|
712
|
+
|
|
713
|
+
// Step 3: Create server definition
|
|
714
|
+
console.log('\n3ļøā£ Creating server definition...');
|
|
715
|
+
const serverName = this._extractServerName(packageName);
|
|
716
|
+
const serverPath = path.join(this.mcpDir, `${serverName}.md`);
|
|
717
|
+
|
|
718
|
+
// Ensure mcp directory exists
|
|
719
|
+
if (!fs.existsSync(this.mcpDir)) {
|
|
720
|
+
fs.mkdirSync(this.mcpDir, { recursive: true });
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// Create .md file
|
|
724
|
+
const serverContent = this._generateServerDefinition(pkg, packageName);
|
|
725
|
+
fs.writeFileSync(serverPath, serverContent, 'utf8');
|
|
726
|
+
console.log(` ā
Created: .claude/mcp/${serverName}.md`);
|
|
727
|
+
|
|
728
|
+
// Step 4: Enable if requested
|
|
729
|
+
if (options.enable) {
|
|
730
|
+
console.log('\n4ļøā£ Enabling server...');
|
|
731
|
+
this.enable(serverName);
|
|
732
|
+
console.log(' ā
Enabled in config.json');
|
|
733
|
+
|
|
734
|
+
console.log('\n5ļøā£ Syncing configuration...');
|
|
735
|
+
this.sync();
|
|
736
|
+
console.log(' ā
Updated: .claude/mcp-servers.json');
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
console.log(`\nš MCP server '${serverName}' ready to use!`);
|
|
740
|
+
console.log('\nš Next steps:');
|
|
741
|
+
if (!options.enable) {
|
|
742
|
+
console.log(` 1. Enable: autopm mcp enable ${serverName}`);
|
|
743
|
+
console.log(' 2. Sync: autopm mcp sync');
|
|
744
|
+
}
|
|
745
|
+
console.log(` 3. Configure environment: nano .claude/.env`);
|
|
746
|
+
console.log(` 4. Test connection: autopm mcp test ${serverName}`);
|
|
747
|
+
|
|
748
|
+
} catch (error) {
|
|
749
|
+
console.error('ā Installation failed:', error.message);
|
|
750
|
+
console.log('\nš” Troubleshooting:');
|
|
751
|
+
console.log(' - Check package name is correct');
|
|
752
|
+
console.log(' - Try: npm install -g ' + packageName);
|
|
753
|
+
console.log(' - Visit: https://www.npmjs.com/package/' + packageName);
|
|
754
|
+
process.exit(1);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Uninstall MCP server
|
|
760
|
+
* @param {string} serverName - Server name
|
|
761
|
+
* @param {Object} options - Uninstallation options
|
|
762
|
+
*/
|
|
763
|
+
async uninstallServer(serverName, options = {}) {
|
|
764
|
+
console.log(`šļø Uninstalling MCP server '${serverName}'...\n`);
|
|
765
|
+
|
|
766
|
+
const serverPath = path.join(this.mcpDir, `${serverName}.md`);
|
|
767
|
+
|
|
768
|
+
if (!fs.existsSync(serverPath)) {
|
|
769
|
+
console.error(`ā Server '${serverName}' not found`);
|
|
770
|
+
console.log('\nš” List available servers: autopm mcp list');
|
|
771
|
+
process.exit(1);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
try {
|
|
775
|
+
// Step 1: Check status
|
|
776
|
+
console.log('1ļøā£ Checking server status...');
|
|
777
|
+
const config = this.loadConfig();
|
|
778
|
+
const isActive = (config.mcp?.activeServers || []).includes(serverName);
|
|
779
|
+
if (isActive) {
|
|
780
|
+
console.log(' ā ļø Server is currently enabled');
|
|
781
|
+
} else {
|
|
782
|
+
console.log(' ā
Server is not active');
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
// Step 2: Disable if active
|
|
786
|
+
if (isActive && !options.force) {
|
|
787
|
+
console.log('\n2ļøā£ Disabling server...');
|
|
788
|
+
this.disable(serverName);
|
|
789
|
+
console.log(' ā
Disabled in config.json');
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
// Step 3: Remove definition
|
|
793
|
+
console.log('\n3ļøā£ Removing server definition...');
|
|
794
|
+
fs.unlinkSync(serverPath);
|
|
795
|
+
console.log(` ā
Deleted: .claude/mcp/${serverName}.md`);
|
|
796
|
+
|
|
797
|
+
// Step 4: Uninstall npm package (unless --keep-package)
|
|
798
|
+
if (!options.keepPackage) {
|
|
799
|
+
console.log('\n4ļøā£ Uninstalling npm package...');
|
|
800
|
+
try {
|
|
801
|
+
const { execSync } = require('child_process');
|
|
802
|
+
// Try to find package name from .md file (but it's deleted, so we'll guess)
|
|
803
|
+
execSync(`npm uninstall -g @modelcontextprotocol/server-${serverName}`, {
|
|
804
|
+
stdio: 'ignore'
|
|
805
|
+
});
|
|
806
|
+
console.log(' ā
Uninstalled npm package');
|
|
807
|
+
} catch (error) {
|
|
808
|
+
console.log(' ā ļø Could not uninstall npm package automatically');
|
|
809
|
+
console.log(' š” Try: npm uninstall -g <package-name>');
|
|
810
|
+
}
|
|
811
|
+
} else {
|
|
812
|
+
console.log('\n4ļøā£ Keeping npm package (--keep-package)');
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
// Step 5: Clean up config
|
|
816
|
+
console.log('\n5ļøā£ Cleaning up configuration...');
|
|
817
|
+
this.sync();
|
|
818
|
+
console.log(' ā
Updated: .claude/mcp-servers.json');
|
|
819
|
+
|
|
820
|
+
console.log(`\n⨠Server '${serverName}' completely removed`);
|
|
821
|
+
|
|
822
|
+
} catch (error) {
|
|
823
|
+
console.error('ā Uninstallation failed:', error.message);
|
|
824
|
+
process.exit(1);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
// Helper methods for discovery/installation
|
|
829
|
+
|
|
830
|
+
_formatDownloads(pkg) {
|
|
831
|
+
// npm search doesn't always include download counts
|
|
832
|
+
return pkg.date ? `Last publish: ${pkg.date}` : 'N/A';
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
_extractServerName(packageName) {
|
|
836
|
+
// Extract server name from package
|
|
837
|
+
// @modelcontextprotocol/server-filesystem -> filesystem
|
|
838
|
+
// @upstash/context7-mcp -> context7-mcp
|
|
839
|
+
const parts = packageName.split('/');
|
|
840
|
+
const name = parts[parts.length - 1];
|
|
841
|
+
return name.replace('server-', '').replace('-mcp', '');
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
_generateServerDefinition(pkg, packageName) {
|
|
845
|
+
const serverName = this._extractServerName(packageName);
|
|
846
|
+
const category = this._guessCategory(pkg);
|
|
847
|
+
|
|
848
|
+
return `---
|
|
849
|
+
name: ${serverName}
|
|
850
|
+
command: npx
|
|
851
|
+
args: ["${packageName}"]
|
|
852
|
+
description: ${pkg.description || 'MCP server'}
|
|
853
|
+
category: ${category}
|
|
854
|
+
status: active
|
|
855
|
+
version: ${pkg.version}
|
|
856
|
+
installed: ${new Date().toISOString()}
|
|
857
|
+
---
|
|
858
|
+
|
|
859
|
+
# ${pkg.name}
|
|
860
|
+
|
|
861
|
+
## Description
|
|
862
|
+
${pkg.description || 'MCP server'}
|
|
863
|
+
|
|
864
|
+
## Installation
|
|
865
|
+
This server was automatically installed via:
|
|
866
|
+
\`\`\`bash
|
|
867
|
+
autopm mcp install ${packageName}
|
|
868
|
+
\`\`\`
|
|
869
|
+
|
|
870
|
+
## Configuration
|
|
871
|
+
Configure environment variables in \`.claude/.env\` if needed.
|
|
872
|
+
|
|
873
|
+
## Usage
|
|
874
|
+
Enable this server:
|
|
875
|
+
\`\`\`bash
|
|
876
|
+
autopm mcp enable ${serverName}
|
|
877
|
+
autopm mcp sync
|
|
878
|
+
\`\`\`
|
|
879
|
+
|
|
880
|
+
## Links
|
|
881
|
+
- NPM: https://www.npmjs.com/package/${packageName}
|
|
882
|
+
${pkg.homepage ? `- Homepage: ${pkg.homepage}` : ''}
|
|
883
|
+
${pkg.repository?.url ? `- Repository: ${pkg.repository.url}` : ''}
|
|
884
|
+
`;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
_guessCategory(pkg) {
|
|
888
|
+
const name = (pkg.name || '').toLowerCase();
|
|
889
|
+
const desc = (pkg.description || '').toLowerCase();
|
|
890
|
+
const text = name + ' ' + desc;
|
|
891
|
+
|
|
892
|
+
if (text.includes('filesystem') || text.includes('file')) return 'codebase';
|
|
893
|
+
if (text.includes('doc') || text.includes('context7')) return 'documentation';
|
|
894
|
+
if (text.includes('test') || text.includes('playwright')) return 'testing';
|
|
895
|
+
if (text.includes('database') || text.includes('sql') || text.includes('memory')) return 'database';
|
|
896
|
+
if (text.includes('github') || text.includes('git')) return 'integration';
|
|
897
|
+
|
|
898
|
+
return 'utility';
|
|
899
|
+
}
|
|
900
|
+
|
|
558
901
|
// ==========================================
|
|
559
902
|
// EXTENDED FEATURES: Agent Analysis
|
|
560
903
|
// ==========================================
|
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: context7-codebase
|
|
3
|
-
command: npx
|
|
4
|
-
args: ["@upstash/context7-mcp"]
|
|
5
|
-
env:
|
|
6
|
-
CONTEXT7_API_KEY: "${CONTEXT7_API_KEY:-}"
|
|
7
|
-
CONTEXT7_MCP_URL: "${CONTEXT7_MCP_URL:-https://mcp.context7.com/mcp}"
|
|
8
|
-
CONTEXT7_API_URL: "${CONTEXT7_API_URL:-https://context7.com/api/v1}"
|
|
9
|
-
CONTEXT7_WORKSPACE: "${CONTEXT7_WORKSPACE:-}"
|
|
10
|
-
CONTEXT7_MODE: "codebase"
|
|
11
|
-
envFile: .claude/.env
|
|
12
|
-
description: Context7 codebase server for project code analysis and navigation
|
|
13
|
-
category: codebase
|
|
14
|
-
status: active
|
|
15
|
-
version: ">=1.0.0"
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
# Context7 Codebase Server
|
|
19
|
-
|
|
20
|
-
## Description
|
|
21
|
-
|
|
22
|
-
The Context7 Codebase Server provides intelligent code analysis, navigation, and understanding capabilities for your project. It indexes and analyzes your codebase to provide context-aware assistance for development tasks.
|
|
23
|
-
|
|
24
|
-
## Features
|
|
25
|
-
|
|
26
|
-
- **Code Indexing**: Automatic indexing of project files
|
|
27
|
-
- **Semantic Analysis**: Understanding code structure and relationships
|
|
28
|
-
- **Dependency Tracking**: Tracks imports and dependencies
|
|
29
|
-
- **Change Detection**: Monitors code changes in real-time
|
|
30
|
-
- **Cross-Reference**: Links between related code elements
|
|
31
|
-
- **Pattern Recognition**: Identifies common patterns and anti-patterns
|
|
32
|
-
|
|
33
|
-
## Configuration
|
|
34
|
-
|
|
35
|
-
### Required Environment Variables
|
|
36
|
-
|
|
37
|
-
- `CONTEXT7_API_KEY`: Your Context7 API key (required)
|
|
38
|
-
- `CONTEXT7_WORKSPACE`: Your workspace identifier (required for codebase mode)
|
|
39
|
-
|
|
40
|
-
### Optional Environment Variables
|
|
41
|
-
|
|
42
|
-
- `CONTEXT7_MCP_URL`: MCP endpoint URL (default: mcp.context7.com/mcp)
|
|
43
|
-
- `CONTEXT7_API_URL`: API endpoint URL (default: context7.com/api/v1)
|
|
44
|
-
- `CONTEXT7_MODE`: Must be set to "codebase"
|
|
45
|
-
|
|
46
|
-
## Usage Examples
|
|
47
|
-
|
|
48
|
-
### Basic Setup
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
# Enable the server
|
|
52
|
-
autopm mcp enable context7-codebase
|
|
53
|
-
|
|
54
|
-
# Configure environment
|
|
55
|
-
echo "CONTEXT7_API_KEY=your-api-key" >> .claude/.env
|
|
56
|
-
echo "CONTEXT7_WORKSPACE=project-workspace" >> .claude/.env
|
|
57
|
-
|
|
58
|
-
# Sync configuration
|
|
59
|
-
autopm mcp sync
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Project Indexing
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
# Index current project
|
|
66
|
-
context7 index .
|
|
67
|
-
|
|
68
|
-
# Exclude directories
|
|
69
|
-
context7 index . --exclude node_modules,dist,build
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Integration with Agents
|
|
73
|
-
|
|
74
|
-
Commonly used with:
|
|
75
|
-
- `code-analyzer` - For code quality analysis
|
|
76
|
-
- `python-backend-engineer` - For Python projects
|
|
77
|
-
- `react-frontend-engineer` - For React projects
|
|
78
|
-
- `test-runner` - For test coverage analysis
|
|
79
|
-
|
|
80
|
-
### Context Pool Configuration
|
|
81
|
-
|
|
82
|
-
```json
|
|
83
|
-
{
|
|
84
|
-
"project-context": {
|
|
85
|
-
"type": "persistent",
|
|
86
|
-
"agents": ["code-analyzer", "python-backend-engineer"],
|
|
87
|
-
"sources": ["context7-codebase"],
|
|
88
|
-
"maxSize": "300MB",
|
|
89
|
-
"retention": "30d",
|
|
90
|
-
"refresh": "on-change"
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Supported Languages & Frameworks
|
|
96
|
-
|
|
97
|
-
### Languages
|
|
98
|
-
- Python (including type hints)
|
|
99
|
-
- JavaScript/TypeScript
|
|
100
|
-
- Java
|
|
101
|
-
- Go
|
|
102
|
-
- Rust
|
|
103
|
-
- C/C++
|
|
104
|
-
- Ruby
|
|
105
|
-
- PHP
|
|
106
|
-
|
|
107
|
-
### Frameworks
|
|
108
|
-
- FastAPI, Django, Flask (Python)
|
|
109
|
-
- React, Vue, Angular (JavaScript)
|
|
110
|
-
- Spring Boot (Java)
|
|
111
|
-
- Express, NestJS (Node.js)
|
|
112
|
-
|
|
113
|
-
### File Types
|
|
114
|
-
- Source code (`.py`, `.js`, `.ts`, etc.)
|
|
115
|
-
- Configuration (`.json`, `.yaml`, `.toml`)
|
|
116
|
-
- Documentation (`.md`, `.rst`)
|
|
117
|
-
- Docker files
|
|
118
|
-
- CI/CD pipelines
|
|
119
|
-
|
|
120
|
-
## Indexing Configuration
|
|
121
|
-
|
|
122
|
-
### .context7ignore
|
|
123
|
-
|
|
124
|
-
Create a `.context7ignore` file to exclude files from indexing:
|
|
125
|
-
|
|
126
|
-
```
|
|
127
|
-
# Dependencies
|
|
128
|
-
node_modules/
|
|
129
|
-
venv/
|
|
130
|
-
.venv/
|
|
131
|
-
|
|
132
|
-
# Build outputs
|
|
133
|
-
dist/
|
|
134
|
-
build/
|
|
135
|
-
*.pyc
|
|
136
|
-
__pycache__/
|
|
137
|
-
|
|
138
|
-
# Large files
|
|
139
|
-
*.log
|
|
140
|
-
*.sqlite
|
|
141
|
-
*.db
|
|
142
|
-
|
|
143
|
-
# Sensitive data
|
|
144
|
-
.env
|
|
145
|
-
*.key
|
|
146
|
-
*.pem
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Index Settings
|
|
150
|
-
|
|
151
|
-
```json
|
|
152
|
-
{
|
|
153
|
-
"indexing": {
|
|
154
|
-
"incremental": true,
|
|
155
|
-
"parallel": true,
|
|
156
|
-
"maxFileSize": "10MB",
|
|
157
|
-
"languages": ["python", "javascript", "typescript"],
|
|
158
|
-
"includeTests": true,
|
|
159
|
-
"includeComments": true
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
## Performance Optimization
|
|
165
|
-
|
|
166
|
-
### Indexing Strategy
|
|
167
|
-
- Incremental indexing for large codebases
|
|
168
|
-
- Parallel processing for faster indexing
|
|
169
|
-
- Smart caching of analysis results
|
|
170
|
-
|
|
171
|
-
### Memory Management
|
|
172
|
-
- Configurable memory limits
|
|
173
|
-
- Automatic garbage collection
|
|
174
|
-
- Efficient data structures
|
|
175
|
-
|
|
176
|
-
## Advanced Features
|
|
177
|
-
|
|
178
|
-
### Code Intelligence
|
|
179
|
-
|
|
180
|
-
```yaml
|
|
181
|
-
features:
|
|
182
|
-
- symbol_resolution
|
|
183
|
-
- type_inference
|
|
184
|
-
- dead_code_detection
|
|
185
|
-
- cyclomatic_complexity
|
|
186
|
-
- test_coverage_mapping
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### Real-time Monitoring
|
|
190
|
-
|
|
191
|
-
- File system watch for changes
|
|
192
|
-
- Git integration for version tracking
|
|
193
|
-
- Branch-aware indexing
|
|
194
|
-
|
|
195
|
-
## Troubleshooting
|
|
196
|
-
|
|
197
|
-
### Common Issues
|
|
198
|
-
|
|
199
|
-
1. **Indexing Timeout**
|
|
200
|
-
- Reduce scope with `.context7ignore`
|
|
201
|
-
- Enable incremental indexing
|
|
202
|
-
- Increase timeout settings
|
|
203
|
-
|
|
204
|
-
2. **Memory Issues**
|
|
205
|
-
- Set memory limits in configuration
|
|
206
|
-
- Exclude large binary files
|
|
207
|
-
- Use filtering for specific languages
|
|
208
|
-
|
|
209
|
-
3. **Sync Problems**
|
|
210
|
-
- Check workspace permissions
|
|
211
|
-
- Verify git status
|
|
212
|
-
- Clear local cache
|
|
213
|
-
|
|
214
|
-
### Debug Mode
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
export CONTEXT7_DEBUG=true
|
|
218
|
-
export CONTEXT7_VERBOSE=true
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
## Security Considerations
|
|
222
|
-
|
|
223
|
-
1. **Code Privacy**
|
|
224
|
-
- Code is processed securely
|
|
225
|
-
- No code storage without permission
|
|
226
|
-
- Encrypted transmission
|
|
227
|
-
|
|
228
|
-
2. **Access Control**
|
|
229
|
-
- Workspace-level permissions
|
|
230
|
-
- Read-only by default
|
|
231
|
-
- Audit logging enabled
|
|
232
|
-
|
|
233
|
-
3. **Sensitive Data**
|
|
234
|
-
- Automatic secret detection
|
|
235
|
-
- Pattern-based exclusion
|
|
236
|
-
- Environment variable masking
|
|
237
|
-
|
|
238
|
-
## Best Practices
|
|
239
|
-
|
|
240
|
-
1. **Initial Setup**
|
|
241
|
-
- Start with a clean codebase
|
|
242
|
-
- Configure `.context7ignore` first
|
|
243
|
-
- Run initial index during off-hours
|
|
244
|
-
|
|
245
|
-
2. **Maintenance**
|
|
246
|
-
- Regular re-indexing for accuracy
|
|
247
|
-
- Monitor index size
|
|
248
|
-
- Clean up old indexes
|
|
249
|
-
|
|
250
|
-
3. **Team Usage**
|
|
251
|
-
- Share workspace configuration
|
|
252
|
-
- Consistent ignore patterns
|
|
253
|
-
- Document custom settings
|
|
254
|
-
|
|
255
|
-
## Version History
|
|
256
|
-
|
|
257
|
-
- **1.0.0**: Initial release
|
|
258
|
-
- **1.1.0**: Added incremental indexing
|
|
259
|
-
- **1.2.0**: Multi-language support
|
|
260
|
-
- **1.3.0**: Real-time monitoring
|
|
261
|
-
- **1.4.0**: Advanced code intelligence
|
|
262
|
-
|
|
263
|
-
## Related Resources
|
|
264
|
-
|
|
265
|
-
- [Context7 Codebase Docs](https://docs.context7.com/codebase)
|
|
266
|
-
- [Indexing Best Practices](https://docs.context7.com/best-practices)
|
|
267
|
-
- [Code Analysis Guide](../agents/code-analyzer.md)
|