codetyper-cli 0.2.0 → 0.2.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/README.md +23 -3
- package/dist/index.js +677 -4
- package/package.json +1 -1
- package/src/version.json +1 -1
package/README.md
CHANGED
|
@@ -284,11 +284,31 @@ CodeTyper has access to these built-in tools:
|
|
|
284
284
|
Connect external MCP (Model Context Protocol) servers for extended capabilities:
|
|
285
285
|
|
|
286
286
|
```bash
|
|
287
|
-
#
|
|
288
|
-
/mcp
|
|
289
|
-
|
|
287
|
+
# Browse and search available servers
|
|
288
|
+
/mcp browse # Interactive browser
|
|
289
|
+
/mcp search <query> # Search by keyword
|
|
290
|
+
/mcp popular # Show popular servers
|
|
291
|
+
/mcp categories # List all categories
|
|
292
|
+
|
|
293
|
+
# Install a server
|
|
294
|
+
/mcp install sqlite
|
|
295
|
+
/mcp install github
|
|
296
|
+
|
|
297
|
+
# Manage servers
|
|
298
|
+
/mcp status # Show connected servers
|
|
299
|
+
/mcp connect # Connect all servers
|
|
300
|
+
/mcp disconnect # Disconnect all servers
|
|
301
|
+
/mcp tools # List available tools
|
|
302
|
+
/mcp add # Add custom server
|
|
290
303
|
```
|
|
291
304
|
|
|
305
|
+
**MCP Browser Features:**
|
|
306
|
+
- Search by name, description, or tags
|
|
307
|
+
- Filter by category (database, web, AI, etc.)
|
|
308
|
+
- View server details and required environment variables
|
|
309
|
+
- One-click installation and connection
|
|
310
|
+
- 15+ verified servers from Anthropic
|
|
311
|
+
|
|
292
312
|
## Extensibility
|
|
293
313
|
|
|
294
314
|
### Hooks System
|
package/dist/index.js
CHANGED
|
@@ -73666,14 +73666,565 @@ var init_semantic_search = __esm(() => {
|
|
|
73666
73666
|
var version_default;
|
|
73667
73667
|
var init_version = __esm(() => {
|
|
73668
73668
|
version_default = {
|
|
73669
|
-
version: "0.2.
|
|
73669
|
+
version: "0.2.1"
|
|
73670
|
+
};
|
|
73671
|
+
});
|
|
73672
|
+
|
|
73673
|
+
// src/constants/mcp-registry.ts
|
|
73674
|
+
var MCP_REGISTRY_SOURCES, MCP_REGISTRY_CACHE, MCP_CATEGORY_LABELS, MCP_CATEGORY_ICONS, MCP_SEARCH_DEFAULTS, MCP_CURATED_SERVERS, MCP_REGISTRY_ERRORS;
|
|
73675
|
+
var init_mcp_registry = __esm(() => {
|
|
73676
|
+
MCP_REGISTRY_SOURCES = {
|
|
73677
|
+
OFFICIAL: "https://raw.githubusercontent.com/modelcontextprotocol/servers/main/README.md",
|
|
73678
|
+
SMITHERY: "https://registry.smithery.ai/servers"
|
|
73679
|
+
};
|
|
73680
|
+
MCP_REGISTRY_CACHE = {
|
|
73681
|
+
DURATION_MS: 60 * 60 * 1000,
|
|
73682
|
+
FILE_NAME: "mcp-registry-cache.json"
|
|
73683
|
+
};
|
|
73684
|
+
MCP_CATEGORY_LABELS = {
|
|
73685
|
+
database: "Database",
|
|
73686
|
+
filesystem: "File System",
|
|
73687
|
+
web: "Web & Browser",
|
|
73688
|
+
ai: "AI & ML",
|
|
73689
|
+
"dev-tools": "Developer Tools",
|
|
73690
|
+
productivity: "Productivity",
|
|
73691
|
+
communication: "Communication",
|
|
73692
|
+
cloud: "Cloud Services",
|
|
73693
|
+
security: "Security",
|
|
73694
|
+
other: "Other"
|
|
73695
|
+
};
|
|
73696
|
+
MCP_CATEGORY_ICONS = {
|
|
73697
|
+
database: "\uD83D\uDDC4️",
|
|
73698
|
+
filesystem: "\uD83D\uDCC1",
|
|
73699
|
+
web: "\uD83C\uDF10",
|
|
73700
|
+
ai: "\uD83E\uDD16",
|
|
73701
|
+
"dev-tools": "\uD83D\uDEE0️",
|
|
73702
|
+
productivity: "\uD83D\uDCCB",
|
|
73703
|
+
communication: "\uD83D\uDCAC",
|
|
73704
|
+
cloud: "☁️",
|
|
73705
|
+
security: "\uD83D\uDD12",
|
|
73706
|
+
other: "\uD83D\uDCE6"
|
|
73707
|
+
};
|
|
73708
|
+
MCP_SEARCH_DEFAULTS = {
|
|
73709
|
+
LIMIT: 20,
|
|
73710
|
+
SORT_BY: "popularity"
|
|
73711
|
+
};
|
|
73712
|
+
MCP_CURATED_SERVERS = [
|
|
73713
|
+
{
|
|
73714
|
+
id: "filesystem",
|
|
73715
|
+
name: "Filesystem",
|
|
73716
|
+
description: "Read, write, and manage files on the local filesystem",
|
|
73717
|
+
author: "Anthropic",
|
|
73718
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73719
|
+
package: "@modelcontextprotocol/server-filesystem",
|
|
73720
|
+
command: "npx",
|
|
73721
|
+
args: ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"],
|
|
73722
|
+
category: "filesystem",
|
|
73723
|
+
tags: ["files", "read", "write", "directory"],
|
|
73724
|
+
transport: "stdio",
|
|
73725
|
+
version: "latest",
|
|
73726
|
+
popularity: 100,
|
|
73727
|
+
verified: true,
|
|
73728
|
+
installHint: "Replace /path/to/dir with the directory you want to access",
|
|
73729
|
+
updatedAt: "2024-12-01"
|
|
73730
|
+
},
|
|
73731
|
+
{
|
|
73732
|
+
id: "sqlite",
|
|
73733
|
+
name: "SQLite",
|
|
73734
|
+
description: "Query and manage SQLite databases",
|
|
73735
|
+
author: "Anthropic",
|
|
73736
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73737
|
+
package: "@modelcontextprotocol/server-sqlite",
|
|
73738
|
+
command: "npx",
|
|
73739
|
+
args: ["-y", "@modelcontextprotocol/server-sqlite", "/path/to/db.sqlite"],
|
|
73740
|
+
category: "database",
|
|
73741
|
+
tags: ["sql", "database", "query", "sqlite"],
|
|
73742
|
+
transport: "stdio",
|
|
73743
|
+
version: "latest",
|
|
73744
|
+
popularity: 95,
|
|
73745
|
+
verified: true,
|
|
73746
|
+
installHint: "Replace /path/to/db.sqlite with your database file path",
|
|
73747
|
+
updatedAt: "2024-12-01"
|
|
73748
|
+
},
|
|
73749
|
+
{
|
|
73750
|
+
id: "postgres",
|
|
73751
|
+
name: "PostgreSQL",
|
|
73752
|
+
description: "Connect to and query PostgreSQL databases",
|
|
73753
|
+
author: "Anthropic",
|
|
73754
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73755
|
+
package: "@modelcontextprotocol/server-postgres",
|
|
73756
|
+
command: "npx",
|
|
73757
|
+
args: ["-y", "@modelcontextprotocol/server-postgres"],
|
|
73758
|
+
category: "database",
|
|
73759
|
+
tags: ["sql", "database", "query", "postgres", "postgresql"],
|
|
73760
|
+
transport: "stdio",
|
|
73761
|
+
version: "latest",
|
|
73762
|
+
popularity: 90,
|
|
73763
|
+
verified: true,
|
|
73764
|
+
envVars: ["POSTGRES_CONNECTION_STRING"],
|
|
73765
|
+
installHint: "Set POSTGRES_CONNECTION_STRING environment variable",
|
|
73766
|
+
updatedAt: "2024-12-01"
|
|
73767
|
+
},
|
|
73768
|
+
{
|
|
73769
|
+
id: "github",
|
|
73770
|
+
name: "GitHub",
|
|
73771
|
+
description: "Interact with GitHub repositories, issues, and pull requests",
|
|
73772
|
+
author: "Anthropic",
|
|
73773
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73774
|
+
package: "@modelcontextprotocol/server-github",
|
|
73775
|
+
command: "npx",
|
|
73776
|
+
args: ["-y", "@modelcontextprotocol/server-github"],
|
|
73777
|
+
category: "dev-tools",
|
|
73778
|
+
tags: ["github", "git", "repository", "issues", "pr"],
|
|
73779
|
+
transport: "stdio",
|
|
73780
|
+
version: "latest",
|
|
73781
|
+
popularity: 92,
|
|
73782
|
+
verified: true,
|
|
73783
|
+
envVars: ["GITHUB_PERSONAL_ACCESS_TOKEN"],
|
|
73784
|
+
installHint: "Set GITHUB_PERSONAL_ACCESS_TOKEN environment variable",
|
|
73785
|
+
updatedAt: "2024-12-01"
|
|
73786
|
+
},
|
|
73787
|
+
{
|
|
73788
|
+
id: "gitlab",
|
|
73789
|
+
name: "GitLab",
|
|
73790
|
+
description: "Interact with GitLab repositories and CI/CD",
|
|
73791
|
+
author: "Anthropic",
|
|
73792
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73793
|
+
package: "@modelcontextprotocol/server-gitlab",
|
|
73794
|
+
command: "npx",
|
|
73795
|
+
args: ["-y", "@modelcontextprotocol/server-gitlab"],
|
|
73796
|
+
category: "dev-tools",
|
|
73797
|
+
tags: ["gitlab", "git", "repository", "ci", "cd"],
|
|
73798
|
+
transport: "stdio",
|
|
73799
|
+
version: "latest",
|
|
73800
|
+
popularity: 75,
|
|
73801
|
+
verified: true,
|
|
73802
|
+
envVars: ["GITLAB_PERSONAL_ACCESS_TOKEN", "GITLAB_API_URL"],
|
|
73803
|
+
installHint: "Set GITLAB_PERSONAL_ACCESS_TOKEN and optionally GITLAB_API_URL",
|
|
73804
|
+
updatedAt: "2024-12-01"
|
|
73805
|
+
},
|
|
73806
|
+
{
|
|
73807
|
+
id: "slack",
|
|
73808
|
+
name: "Slack",
|
|
73809
|
+
description: "Send messages and interact with Slack workspaces",
|
|
73810
|
+
author: "Anthropic",
|
|
73811
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73812
|
+
package: "@modelcontextprotocol/server-slack",
|
|
73813
|
+
command: "npx",
|
|
73814
|
+
args: ["-y", "@modelcontextprotocol/server-slack"],
|
|
73815
|
+
category: "communication",
|
|
73816
|
+
tags: ["slack", "messaging", "chat", "team"],
|
|
73817
|
+
transport: "stdio",
|
|
73818
|
+
version: "latest",
|
|
73819
|
+
popularity: 80,
|
|
73820
|
+
verified: true,
|
|
73821
|
+
envVars: ["SLACK_BOT_TOKEN", "SLACK_TEAM_ID"],
|
|
73822
|
+
installHint: "Set SLACK_BOT_TOKEN and SLACK_TEAM_ID environment variables",
|
|
73823
|
+
updatedAt: "2024-12-01"
|
|
73824
|
+
},
|
|
73825
|
+
{
|
|
73826
|
+
id: "google-drive",
|
|
73827
|
+
name: "Google Drive",
|
|
73828
|
+
description: "Access and manage files in Google Drive",
|
|
73829
|
+
author: "Anthropic",
|
|
73830
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73831
|
+
package: "@modelcontextprotocol/server-gdrive",
|
|
73832
|
+
command: "npx",
|
|
73833
|
+
args: ["-y", "@modelcontextprotocol/server-gdrive"],
|
|
73834
|
+
category: "cloud",
|
|
73835
|
+
tags: ["google", "drive", "cloud", "storage", "files"],
|
|
73836
|
+
transport: "stdio",
|
|
73837
|
+
version: "latest",
|
|
73838
|
+
popularity: 78,
|
|
73839
|
+
verified: true,
|
|
73840
|
+
installHint: "Requires Google OAuth credentials setup",
|
|
73841
|
+
updatedAt: "2024-12-01"
|
|
73842
|
+
},
|
|
73843
|
+
{
|
|
73844
|
+
id: "memory",
|
|
73845
|
+
name: "Memory",
|
|
73846
|
+
description: "Persistent memory and knowledge graph for context",
|
|
73847
|
+
author: "Anthropic",
|
|
73848
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73849
|
+
package: "@modelcontextprotocol/server-memory",
|
|
73850
|
+
command: "npx",
|
|
73851
|
+
args: ["-y", "@modelcontextprotocol/server-memory"],
|
|
73852
|
+
category: "ai",
|
|
73853
|
+
tags: ["memory", "knowledge", "graph", "context", "persistent"],
|
|
73854
|
+
transport: "stdio",
|
|
73855
|
+
version: "latest",
|
|
73856
|
+
popularity: 85,
|
|
73857
|
+
verified: true,
|
|
73858
|
+
updatedAt: "2024-12-01"
|
|
73859
|
+
},
|
|
73860
|
+
{
|
|
73861
|
+
id: "brave-search",
|
|
73862
|
+
name: "Brave Search",
|
|
73863
|
+
description: "Search the web using Brave Search API",
|
|
73864
|
+
author: "Anthropic",
|
|
73865
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73866
|
+
package: "@modelcontextprotocol/server-brave-search",
|
|
73867
|
+
command: "npx",
|
|
73868
|
+
args: ["-y", "@modelcontextprotocol/server-brave-search"],
|
|
73869
|
+
category: "web",
|
|
73870
|
+
tags: ["search", "web", "brave", "internet"],
|
|
73871
|
+
transport: "stdio",
|
|
73872
|
+
version: "latest",
|
|
73873
|
+
popularity: 82,
|
|
73874
|
+
verified: true,
|
|
73875
|
+
envVars: ["BRAVE_API_KEY"],
|
|
73876
|
+
installHint: "Set BRAVE_API_KEY environment variable",
|
|
73877
|
+
updatedAt: "2024-12-01"
|
|
73878
|
+
},
|
|
73879
|
+
{
|
|
73880
|
+
id: "puppeteer",
|
|
73881
|
+
name: "Puppeteer",
|
|
73882
|
+
description: "Browser automation and web scraping with Puppeteer",
|
|
73883
|
+
author: "Anthropic",
|
|
73884
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73885
|
+
package: "@modelcontextprotocol/server-puppeteer",
|
|
73886
|
+
command: "npx",
|
|
73887
|
+
args: ["-y", "@modelcontextprotocol/server-puppeteer"],
|
|
73888
|
+
category: "web",
|
|
73889
|
+
tags: ["browser", "automation", "scraping", "puppeteer", "chrome"],
|
|
73890
|
+
transport: "stdio",
|
|
73891
|
+
version: "latest",
|
|
73892
|
+
popularity: 76,
|
|
73893
|
+
verified: true,
|
|
73894
|
+
updatedAt: "2024-12-01"
|
|
73895
|
+
},
|
|
73896
|
+
{
|
|
73897
|
+
id: "fetch",
|
|
73898
|
+
name: "Fetch",
|
|
73899
|
+
description: "Make HTTP requests and fetch web content",
|
|
73900
|
+
author: "Anthropic",
|
|
73901
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73902
|
+
package: "@modelcontextprotocol/server-fetch",
|
|
73903
|
+
command: "npx",
|
|
73904
|
+
args: ["-y", "@modelcontextprotocol/server-fetch"],
|
|
73905
|
+
category: "web",
|
|
73906
|
+
tags: ["http", "fetch", "api", "request", "web"],
|
|
73907
|
+
transport: "stdio",
|
|
73908
|
+
version: "latest",
|
|
73909
|
+
popularity: 88,
|
|
73910
|
+
verified: true,
|
|
73911
|
+
updatedAt: "2024-12-01"
|
|
73912
|
+
},
|
|
73913
|
+
{
|
|
73914
|
+
id: "sequential-thinking",
|
|
73915
|
+
name: "Sequential Thinking",
|
|
73916
|
+
description: "Step-by-step reasoning and problem-solving",
|
|
73917
|
+
author: "Anthropic",
|
|
73918
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73919
|
+
package: "@modelcontextprotocol/server-sequential-thinking",
|
|
73920
|
+
command: "npx",
|
|
73921
|
+
args: ["-y", "@modelcontextprotocol/server-sequential-thinking"],
|
|
73922
|
+
category: "ai",
|
|
73923
|
+
tags: ["thinking", "reasoning", "chain-of-thought", "problem-solving"],
|
|
73924
|
+
transport: "stdio",
|
|
73925
|
+
version: "latest",
|
|
73926
|
+
popularity: 70,
|
|
73927
|
+
verified: true,
|
|
73928
|
+
updatedAt: "2024-12-01"
|
|
73929
|
+
},
|
|
73930
|
+
{
|
|
73931
|
+
id: "everart",
|
|
73932
|
+
name: "EverArt",
|
|
73933
|
+
description: "AI image generation with EverArt",
|
|
73934
|
+
author: "Anthropic",
|
|
73935
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73936
|
+
package: "@modelcontextprotocol/server-everart",
|
|
73937
|
+
command: "npx",
|
|
73938
|
+
args: ["-y", "@modelcontextprotocol/server-everart"],
|
|
73939
|
+
category: "ai",
|
|
73940
|
+
tags: ["image", "generation", "ai", "art", "creative"],
|
|
73941
|
+
transport: "stdio",
|
|
73942
|
+
version: "latest",
|
|
73943
|
+
popularity: 65,
|
|
73944
|
+
verified: true,
|
|
73945
|
+
envVars: ["EVERART_API_KEY"],
|
|
73946
|
+
installHint: "Set EVERART_API_KEY environment variable",
|
|
73947
|
+
updatedAt: "2024-12-01"
|
|
73948
|
+
},
|
|
73949
|
+
{
|
|
73950
|
+
id: "sentry",
|
|
73951
|
+
name: "Sentry",
|
|
73952
|
+
description: "Access Sentry error tracking and monitoring",
|
|
73953
|
+
author: "Anthropic",
|
|
73954
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73955
|
+
package: "@modelcontextprotocol/server-sentry",
|
|
73956
|
+
command: "npx",
|
|
73957
|
+
args: ["-y", "@modelcontextprotocol/server-sentry"],
|
|
73958
|
+
category: "dev-tools",
|
|
73959
|
+
tags: ["sentry", "errors", "monitoring", "debugging"],
|
|
73960
|
+
transport: "stdio",
|
|
73961
|
+
version: "latest",
|
|
73962
|
+
popularity: 72,
|
|
73963
|
+
verified: true,
|
|
73964
|
+
envVars: ["SENTRY_AUTH_TOKEN", "SENTRY_ORG"],
|
|
73965
|
+
installHint: "Set SENTRY_AUTH_TOKEN and SENTRY_ORG environment variables",
|
|
73966
|
+
updatedAt: "2024-12-01"
|
|
73967
|
+
},
|
|
73968
|
+
{
|
|
73969
|
+
id: "aws-kb-retrieval",
|
|
73970
|
+
name: "AWS Knowledge Base",
|
|
73971
|
+
description: "Retrieve information from AWS Bedrock Knowledge Bases",
|
|
73972
|
+
author: "Anthropic",
|
|
73973
|
+
repository: "https://github.com/modelcontextprotocol/servers",
|
|
73974
|
+
package: "@modelcontextprotocol/server-aws-kb-retrieval",
|
|
73975
|
+
command: "npx",
|
|
73976
|
+
args: ["-y", "@modelcontextprotocol/server-aws-kb-retrieval"],
|
|
73977
|
+
category: "cloud",
|
|
73978
|
+
tags: ["aws", "bedrock", "knowledge-base", "retrieval", "rag"],
|
|
73979
|
+
transport: "stdio",
|
|
73980
|
+
version: "latest",
|
|
73981
|
+
popularity: 68,
|
|
73982
|
+
verified: true,
|
|
73983
|
+
envVars: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_REGION"],
|
|
73984
|
+
installHint: "Set AWS credentials environment variables",
|
|
73985
|
+
updatedAt: "2024-12-01"
|
|
73986
|
+
}
|
|
73987
|
+
];
|
|
73988
|
+
MCP_REGISTRY_ERRORS = {
|
|
73989
|
+
FETCH_FAILED: "Failed to fetch MCP registry",
|
|
73990
|
+
PARSE_FAILED: "Failed to parse registry data",
|
|
73991
|
+
NOT_FOUND: "No servers found matching your search",
|
|
73992
|
+
INSTALL_FAILED: "Failed to install MCP server",
|
|
73993
|
+
ALREADY_INSTALLED: "Server is already installed"
|
|
73994
|
+
};
|
|
73995
|
+
});
|
|
73996
|
+
|
|
73997
|
+
// src/services/mcp/registry.ts
|
|
73998
|
+
import { homedir as homedir4 } from "os";
|
|
73999
|
+
import { join as join13 } from "path";
|
|
74000
|
+
var registryCache = null, getCacheFilePath = () => {
|
|
74001
|
+
return join13(homedir4(), ".codetyper", MCP_REGISTRY_CACHE.FILE_NAME);
|
|
74002
|
+
}, loadCache = async () => {
|
|
74003
|
+
try {
|
|
74004
|
+
const cachePath = getCacheFilePath();
|
|
74005
|
+
const file2 = Bun.file(cachePath);
|
|
74006
|
+
if (await file2.exists()) {
|
|
74007
|
+
const data = await file2.json();
|
|
74008
|
+
return data;
|
|
74009
|
+
}
|
|
74010
|
+
} catch {}
|
|
74011
|
+
return null;
|
|
74012
|
+
}, saveCache = async (cache) => {
|
|
74013
|
+
try {
|
|
74014
|
+
const cachePath = getCacheFilePath();
|
|
74015
|
+
await Bun.write(cachePath, JSON.stringify(cache, null, 2));
|
|
74016
|
+
} catch {}
|
|
74017
|
+
}, isCacheValid2 = (cache) => {
|
|
74018
|
+
const now = Date.now();
|
|
74019
|
+
return now - cache.updatedAt < MCP_REGISTRY_CACHE.DURATION_MS;
|
|
74020
|
+
}, fetchFromSmithery = async () => {
|
|
74021
|
+
try {
|
|
74022
|
+
const response2 = await fetch(MCP_REGISTRY_SOURCES.SMITHERY);
|
|
74023
|
+
if (!response2.ok) {
|
|
74024
|
+
return [];
|
|
74025
|
+
}
|
|
74026
|
+
const data = await response2.json();
|
|
74027
|
+
if (Array.isArray(data)) {
|
|
74028
|
+
return data.map((server) => ({
|
|
74029
|
+
id: String(server.name || server.id || ""),
|
|
74030
|
+
name: String(server.displayName || server.name || ""),
|
|
74031
|
+
description: String(server.description || ""),
|
|
74032
|
+
author: String(server.author || server.vendor || "Community"),
|
|
74033
|
+
repository: String(server.homepage || server.repository || ""),
|
|
74034
|
+
package: String(server.qualifiedName || server.package || ""),
|
|
74035
|
+
command: "npx",
|
|
74036
|
+
args: ["-y", String(server.qualifiedName || server.package || "")],
|
|
74037
|
+
category: mapCategory(String(server.category || "other")),
|
|
74038
|
+
tags: Array.isArray(server.tags) ? server.tags.map(String) : [],
|
|
74039
|
+
transport: "stdio",
|
|
74040
|
+
version: String(server.version || "latest"),
|
|
74041
|
+
popularity: Number(server.downloads || server.useCount || 0),
|
|
74042
|
+
verified: Boolean(server.verified || server.isOfficial),
|
|
74043
|
+
installHint: String(server.installHint || ""),
|
|
74044
|
+
envVars: Array.isArray(server.environmentVariables) ? server.environmentVariables.map(String) : undefined,
|
|
74045
|
+
updatedAt: String(server.updatedAt || new Date().toISOString())
|
|
74046
|
+
}));
|
|
74047
|
+
}
|
|
74048
|
+
return [];
|
|
74049
|
+
} catch {
|
|
74050
|
+
return [];
|
|
74051
|
+
}
|
|
74052
|
+
}, mapCategory = (category) => {
|
|
74053
|
+
const categoryMap = {
|
|
74054
|
+
database: "database",
|
|
74055
|
+
databases: "database",
|
|
74056
|
+
db: "database",
|
|
74057
|
+
filesystem: "filesystem",
|
|
74058
|
+
files: "filesystem",
|
|
74059
|
+
file: "filesystem",
|
|
74060
|
+
web: "web",
|
|
74061
|
+
browser: "web",
|
|
74062
|
+
http: "web",
|
|
74063
|
+
ai: "ai",
|
|
74064
|
+
ml: "ai",
|
|
74065
|
+
"machine-learning": "ai",
|
|
74066
|
+
"dev-tools": "dev-tools",
|
|
74067
|
+
developer: "dev-tools",
|
|
74068
|
+
development: "dev-tools",
|
|
74069
|
+
tools: "dev-tools",
|
|
74070
|
+
productivity: "productivity",
|
|
74071
|
+
communication: "communication",
|
|
74072
|
+
chat: "communication",
|
|
74073
|
+
messaging: "communication",
|
|
74074
|
+
cloud: "cloud",
|
|
74075
|
+
aws: "cloud",
|
|
74076
|
+
gcp: "cloud",
|
|
74077
|
+
azure: "cloud",
|
|
74078
|
+
security: "security"
|
|
74079
|
+
};
|
|
74080
|
+
const normalized = category.toLowerCase().trim();
|
|
74081
|
+
return categoryMap[normalized] || "other";
|
|
74082
|
+
}, getAllServers = async (forceRefresh = false) => {
|
|
74083
|
+
if (!forceRefresh && registryCache && isCacheValid2(registryCache)) {
|
|
74084
|
+
return registryCache.servers;
|
|
74085
|
+
}
|
|
74086
|
+
if (!forceRefresh) {
|
|
74087
|
+
const diskCache = await loadCache();
|
|
74088
|
+
if (diskCache && isCacheValid2(diskCache)) {
|
|
74089
|
+
registryCache = diskCache;
|
|
74090
|
+
return diskCache.servers;
|
|
74091
|
+
}
|
|
74092
|
+
}
|
|
74093
|
+
const externalServers = await fetchFromSmithery();
|
|
74094
|
+
const curatedIds = new Set(MCP_CURATED_SERVERS.map((s) => s.id));
|
|
74095
|
+
const filteredExternal = externalServers.filter((s) => !curatedIds.has(s.id));
|
|
74096
|
+
const allServers = [...MCP_CURATED_SERVERS, ...filteredExternal];
|
|
74097
|
+
registryCache = {
|
|
74098
|
+
servers: allServers,
|
|
74099
|
+
updatedAt: Date.now(),
|
|
74100
|
+
source: MCP_REGISTRY_SOURCES.SMITHERY
|
|
74101
|
+
};
|
|
74102
|
+
await saveCache(registryCache);
|
|
74103
|
+
return allServers;
|
|
74104
|
+
}, searchServers = async (options2 = {}) => {
|
|
74105
|
+
const {
|
|
74106
|
+
query = "",
|
|
74107
|
+
category,
|
|
74108
|
+
tags,
|
|
74109
|
+
verifiedOnly = false,
|
|
74110
|
+
sortBy = MCP_SEARCH_DEFAULTS.SORT_BY,
|
|
74111
|
+
limit = MCP_SEARCH_DEFAULTS.LIMIT,
|
|
74112
|
+
offset = 0
|
|
74113
|
+
} = options2;
|
|
74114
|
+
const allServers = await getAllServers();
|
|
74115
|
+
let filtered = allServers;
|
|
74116
|
+
if (query) {
|
|
74117
|
+
const lowerQuery = query.toLowerCase();
|
|
74118
|
+
filtered = filtered.filter((server) => {
|
|
74119
|
+
const searchableText = [
|
|
74120
|
+
server.name,
|
|
74121
|
+
server.description,
|
|
74122
|
+
server.author,
|
|
74123
|
+
...server.tags
|
|
74124
|
+
].join(" ").toLowerCase();
|
|
74125
|
+
return searchableText.includes(lowerQuery);
|
|
74126
|
+
});
|
|
74127
|
+
}
|
|
74128
|
+
if (category) {
|
|
74129
|
+
filtered = filtered.filter((server) => server.category === category);
|
|
74130
|
+
}
|
|
74131
|
+
if (tags && tags.length > 0) {
|
|
74132
|
+
filtered = filtered.filter((server) => tags.some((tag) => server.tags.some((serverTag) => serverTag.toLowerCase().includes(tag.toLowerCase()))));
|
|
74133
|
+
}
|
|
74134
|
+
if (verifiedOnly) {
|
|
74135
|
+
filtered = filtered.filter((server) => server.verified);
|
|
74136
|
+
}
|
|
74137
|
+
const sortFunctions = {
|
|
74138
|
+
popularity: (a2, b2) => b2.popularity - a2.popularity,
|
|
74139
|
+
name: (a2, b2) => a2.name.localeCompare(b2.name),
|
|
74140
|
+
updated: (a2, b2) => new Date(b2.updatedAt).getTime() - new Date(a2.updatedAt).getTime()
|
|
73670
74141
|
};
|
|
74142
|
+
filtered.sort(sortFunctions[sortBy] || sortFunctions.popularity);
|
|
74143
|
+
const total = filtered.length;
|
|
74144
|
+
const paginated = filtered.slice(offset, offset + limit);
|
|
74145
|
+
return {
|
|
74146
|
+
servers: paginated,
|
|
74147
|
+
total,
|
|
74148
|
+
query,
|
|
74149
|
+
category
|
|
74150
|
+
};
|
|
74151
|
+
}, getServerById = async (id) => {
|
|
74152
|
+
const allServers = await getAllServers();
|
|
74153
|
+
return allServers.find((server) => server.id === id);
|
|
74154
|
+
}, isServerInstalled = (serverId) => {
|
|
74155
|
+
const instances = getServerInstances();
|
|
74156
|
+
return instances.some((instance) => instance.config.name === serverId || instance.config.name.toLowerCase() === serverId.toLowerCase());
|
|
74157
|
+
}, installServer = async (server, options2 = {}) => {
|
|
74158
|
+
const { global: global3 = false, connect = true, customArgs } = options2;
|
|
74159
|
+
if (isServerInstalled(server.id)) {
|
|
74160
|
+
return {
|
|
74161
|
+
success: false,
|
|
74162
|
+
serverName: server.id,
|
|
74163
|
+
error: MCP_REGISTRY_ERRORS.ALREADY_INSTALLED,
|
|
74164
|
+
connected: false
|
|
74165
|
+
};
|
|
74166
|
+
}
|
|
74167
|
+
try {
|
|
74168
|
+
await addServer({
|
|
74169
|
+
name: server.id,
|
|
74170
|
+
command: server.command,
|
|
74171
|
+
args: customArgs || server.args,
|
|
74172
|
+
transport: server.transport,
|
|
74173
|
+
enabled: true
|
|
74174
|
+
}, global3);
|
|
74175
|
+
let connected = false;
|
|
74176
|
+
if (connect) {
|
|
74177
|
+
try {
|
|
74178
|
+
await connectServer(server.id);
|
|
74179
|
+
connected = true;
|
|
74180
|
+
} catch {}
|
|
74181
|
+
}
|
|
74182
|
+
return {
|
|
74183
|
+
success: true,
|
|
74184
|
+
serverName: server.id,
|
|
74185
|
+
connected
|
|
74186
|
+
};
|
|
74187
|
+
} catch (error49) {
|
|
74188
|
+
return {
|
|
74189
|
+
success: false,
|
|
74190
|
+
serverName: server.id,
|
|
74191
|
+
error: error49 instanceof Error ? error49.message : MCP_REGISTRY_ERRORS.INSTALL_FAILED,
|
|
74192
|
+
connected: false
|
|
74193
|
+
};
|
|
74194
|
+
}
|
|
74195
|
+
}, installServerById = async (serverId, options2 = {}) => {
|
|
74196
|
+
const server = await getServerById(serverId);
|
|
74197
|
+
if (!server) {
|
|
74198
|
+
return {
|
|
74199
|
+
success: false,
|
|
74200
|
+
serverName: serverId,
|
|
74201
|
+
error: MCP_REGISTRY_ERRORS.NOT_FOUND,
|
|
74202
|
+
connected: false
|
|
74203
|
+
};
|
|
74204
|
+
}
|
|
74205
|
+
return installServer(server, options2);
|
|
74206
|
+
}, getPopularServers = async (limit = 10) => {
|
|
74207
|
+
const allServers = await getAllServers();
|
|
74208
|
+
return allServers.sort((a2, b2) => b2.popularity - a2.popularity).slice(0, limit);
|
|
74209
|
+
}, getCategoriesWithCounts = async () => {
|
|
74210
|
+
const allServers = await getAllServers();
|
|
74211
|
+
const counts = new Map;
|
|
74212
|
+
for (const server of allServers) {
|
|
74213
|
+
const current = counts.get(server.category) || 0;
|
|
74214
|
+
counts.set(server.category, current + 1);
|
|
74215
|
+
}
|
|
74216
|
+
return Array.from(counts.entries()).map(([category, count]) => ({ category, count })).sort((a2, b2) => b2.count - a2.count);
|
|
74217
|
+
};
|
|
74218
|
+
var init_registry2 = __esm(() => {
|
|
74219
|
+
init_mcp_registry();
|
|
74220
|
+
init_manager();
|
|
73671
74221
|
});
|
|
73672
74222
|
|
|
73673
74223
|
// src/services/mcp/index.ts
|
|
73674
74224
|
var init_mcp = __esm(() => {
|
|
73675
74225
|
init_client();
|
|
73676
74226
|
init_manager();
|
|
74227
|
+
init_registry2();
|
|
73677
74228
|
});
|
|
73678
74229
|
|
|
73679
74230
|
// src/services/upgrade.ts
|
|
@@ -105890,6 +106441,7 @@ ${basePrompt}`;
|
|
|
105890
106441
|
// src/commands/components/chat/mcp/handle-mcp.ts
|
|
105891
106442
|
init_source();
|
|
105892
106443
|
init_mcp();
|
|
106444
|
+
init_mcp_registry();
|
|
105893
106445
|
|
|
105894
106446
|
// src/commands/components/chat/mcp/show-mcp-status.ts
|
|
105895
106447
|
init_source();
|
|
@@ -105953,12 +106505,17 @@ var handleMCP = async (args) => {
|
|
|
105953
106505
|
connect: handleConnect,
|
|
105954
106506
|
disconnect: handleDisconnect,
|
|
105955
106507
|
tools: handleTools,
|
|
105956
|
-
add: handleAdd
|
|
106508
|
+
add: handleAdd,
|
|
106509
|
+
search: handleSearch,
|
|
106510
|
+
browse: handleBrowse,
|
|
106511
|
+
install: handleInstall,
|
|
106512
|
+
popular: handlePopular,
|
|
106513
|
+
categories: handleCategories
|
|
105957
106514
|
};
|
|
105958
106515
|
const handler = handlers[subcommand];
|
|
105959
106516
|
if (!handler) {
|
|
105960
106517
|
console.log(source_default.yellow(`Unknown MCP command: ${subcommand}`));
|
|
105961
|
-
console.log(source_default.gray("Available: status, connect, disconnect, tools, add"));
|
|
106518
|
+
console.log(source_default.gray("Available: status, connect, disconnect, tools, add, search, browse, install, popular, categories"));
|
|
105962
106519
|
return;
|
|
105963
106520
|
}
|
|
105964
106521
|
await handler(args.slice(1));
|
|
@@ -106035,6 +106592,122 @@ MCP Tools
|
|
|
106035
106592
|
var handleAdd = async (_args) => {
|
|
106036
106593
|
appStore.setMode("mcp_add");
|
|
106037
106594
|
};
|
|
106595
|
+
var handleSearch = async (args) => {
|
|
106596
|
+
const query = args.join(" ");
|
|
106597
|
+
if (!query) {
|
|
106598
|
+
console.log(source_default.yellow(`
|
|
106599
|
+
Usage: /mcp search <query>`));
|
|
106600
|
+
console.log(source_default.gray("Example: /mcp search database"));
|
|
106601
|
+
console.log(source_default.gray("Or use /mcp browse for interactive browser"));
|
|
106602
|
+
console.log();
|
|
106603
|
+
return;
|
|
106604
|
+
}
|
|
106605
|
+
console.log(source_default.gray(`
|
|
106606
|
+
Searching for "${query}"...`));
|
|
106607
|
+
try {
|
|
106608
|
+
const result = await searchServers({ query, limit: 10 });
|
|
106609
|
+
if (result.servers.length === 0) {
|
|
106610
|
+
console.log(source_default.yellow(`
|
|
106611
|
+
No servers found matching your search.`));
|
|
106612
|
+
console.log(source_default.gray("Try /mcp popular to see popular servers"));
|
|
106613
|
+
console.log();
|
|
106614
|
+
return;
|
|
106615
|
+
}
|
|
106616
|
+
console.log(source_default.bold(`
|
|
106617
|
+
Found ${result.total} servers:
|
|
106618
|
+
`));
|
|
106619
|
+
for (const server of result.servers) {
|
|
106620
|
+
const icon = MCP_CATEGORY_ICONS[server.category];
|
|
106621
|
+
const verified = server.verified ? source_default.green(" ✓") : "";
|
|
106622
|
+
console.log(`${icon} ${source_default.white(server.name)}${verified}`);
|
|
106623
|
+
console.log(` ${source_default.gray(server.description)}`);
|
|
106624
|
+
console.log(` ${source_default.cyan("Install:")} /mcp install ${server.id}`);
|
|
106625
|
+
console.log();
|
|
106626
|
+
}
|
|
106627
|
+
} catch (error49) {
|
|
106628
|
+
console.log(source_default.red(`
|
|
106629
|
+
Search failed: ${error49}`));
|
|
106630
|
+
console.log();
|
|
106631
|
+
}
|
|
106632
|
+
};
|
|
106633
|
+
var handleBrowse = async (_args) => {
|
|
106634
|
+
appStore.setMode("mcp_browse");
|
|
106635
|
+
};
|
|
106636
|
+
var handleInstall = async (args) => {
|
|
106637
|
+
const serverId = args[0];
|
|
106638
|
+
if (!serverId) {
|
|
106639
|
+
console.log(source_default.yellow(`
|
|
106640
|
+
Usage: /mcp install <server-id>`));
|
|
106641
|
+
console.log(source_default.gray("Example: /mcp install sqlite"));
|
|
106642
|
+
console.log(source_default.gray("Use /mcp search to find server IDs"));
|
|
106643
|
+
console.log();
|
|
106644
|
+
return;
|
|
106645
|
+
}
|
|
106646
|
+
console.log(source_default.gray(`
|
|
106647
|
+
Installing ${serverId}...`));
|
|
106648
|
+
try {
|
|
106649
|
+
const result = await installServerById(serverId, { connect: true });
|
|
106650
|
+
if (result.success) {
|
|
106651
|
+
console.log(source_default.green(`
|
|
106652
|
+
✓ Installed ${result.serverName}`));
|
|
106653
|
+
if (result.connected) {
|
|
106654
|
+
console.log(source_default.gray(" Server is now connected"));
|
|
106655
|
+
}
|
|
106656
|
+
} else {
|
|
106657
|
+
console.log(source_default.red(`
|
|
106658
|
+
✗ Installation failed: ${result.error}`));
|
|
106659
|
+
}
|
|
106660
|
+
console.log();
|
|
106661
|
+
} catch (error49) {
|
|
106662
|
+
console.log(source_default.red(`
|
|
106663
|
+
Installation failed: ${error49}`));
|
|
106664
|
+
console.log();
|
|
106665
|
+
}
|
|
106666
|
+
};
|
|
106667
|
+
var handlePopular = async (_args) => {
|
|
106668
|
+
console.log(source_default.gray(`
|
|
106669
|
+
Fetching popular servers...`));
|
|
106670
|
+
try {
|
|
106671
|
+
const servers = await getPopularServers(10);
|
|
106672
|
+
console.log(source_default.bold(`
|
|
106673
|
+
Popular MCP Servers:
|
|
106674
|
+
`));
|
|
106675
|
+
for (const server of servers) {
|
|
106676
|
+
const icon = MCP_CATEGORY_ICONS[server.category];
|
|
106677
|
+
const verified = server.verified ? source_default.green(" ✓") : "";
|
|
106678
|
+
console.log(`${icon} ${source_default.white(server.name)}${verified}`);
|
|
106679
|
+
console.log(` ${source_default.gray(server.description)}`);
|
|
106680
|
+
console.log(` ${source_default.cyan("Install:")} /mcp install ${server.id}`);
|
|
106681
|
+
console.log();
|
|
106682
|
+
}
|
|
106683
|
+
} catch (error49) {
|
|
106684
|
+
console.log(source_default.red(`
|
|
106685
|
+
Failed to fetch servers: ${error49}`));
|
|
106686
|
+
console.log();
|
|
106687
|
+
}
|
|
106688
|
+
};
|
|
106689
|
+
var handleCategories = async (_args) => {
|
|
106690
|
+
console.log(source_default.gray(`
|
|
106691
|
+
Fetching categories...`));
|
|
106692
|
+
try {
|
|
106693
|
+
const categories = await getCategoriesWithCounts();
|
|
106694
|
+
console.log(source_default.bold(`
|
|
106695
|
+
MCP Server Categories:
|
|
106696
|
+
`));
|
|
106697
|
+
for (const { category, count } of categories) {
|
|
106698
|
+
const icon = MCP_CATEGORY_ICONS[category];
|
|
106699
|
+
const label = MCP_CATEGORY_LABELS[category];
|
|
106700
|
+
console.log(`${icon} ${source_default.white(label)} ${source_default.gray(`(${count} servers)`)}`);
|
|
106701
|
+
}
|
|
106702
|
+
console.log();
|
|
106703
|
+
console.log(source_default.gray("Use /mcp search <category> to filter by category"));
|
|
106704
|
+
console.log();
|
|
106705
|
+
} catch (error49) {
|
|
106706
|
+
console.log(source_default.red(`
|
|
106707
|
+
Failed to fetch categories: ${error49}`));
|
|
106708
|
+
console.log();
|
|
106709
|
+
}
|
|
106710
|
+
};
|
|
106038
106711
|
|
|
106039
106712
|
// src/commands/components/chat/commands/commandsRegistry.ts
|
|
106040
106713
|
init_terminal2();
|
|
@@ -108272,4 +108945,4 @@ ${plan.steps.map((s) => `${s.id}. ${s.description}`).join(`
|
|
|
108272
108945
|
});
|
|
108273
108946
|
program2.parse(process.argv);
|
|
108274
108947
|
|
|
108275
|
-
//# debugId=
|
|
108948
|
+
//# debugId=A668908B12C6E01864756E2164756E21
|
package/package.json
CHANGED
package/src/version.json
CHANGED