Skip to content

Commit 4a7965e

Browse files
committed
refactor: remove mcp-hub marketplace
1 parent da79457 commit 4a7965e

File tree

10 files changed

+427
-1323
lines changed

10 files changed

+427
-1323
lines changed

packages/agent-infra/mcp-hub/README.md

Lines changed: 3 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,12 @@ The [ravitemer/mcphub.nvim](https://github.com/ravitemer/mcphub.nvim) plugin pro
417417
- Execute MCP tools directly from Neovim
418418
- Access MCP resources within your editing workflow
419419
- Real-time status updates in Neovim
420-
- Auto install mcp servers with marketplace addition
421420

422421
## REST API
423422

424423
### MCP Hub Search API
425424

426-
The MCP Hub provides a powerful search API to find and filter MCP servers, both connected (currently running) and available (from the marketplace).
425+
The MCP Hub provides a powerful search API to find and filter MCP servers that are currently running and connected to the hub.
427426

428427
#### Endpoint
429428

@@ -451,20 +450,10 @@ Response Format
451450
"category": "development",
452451
"tags": ["filesystem", "file-management"],
453452
"status": "connected",
454-
"source": "connected",
455453
"capabilities": {
456454
"tools": [...],
457455
"resources": [...]
458456
}
459-
},
460-
{
461-
"name": "GitHub",
462-
"description": "GitHub API integration",
463-
"category": "development",
464-
"tags": ["github", "api"],
465-
"status": "available",
466-
"source": "marketplace",
467-
"stars": 1000
468457
}
469458
],
470459
"query": {
@@ -481,12 +470,10 @@ Response Format
481470
#### Server Status
482471

483472
- **connected**: Server is currently running and connected to the hub
484-
- **available**: Server is available in the marketplace but not currently connected
485473

486474
#### Server Source
487475

488476
- **connected**: Server is from your local configuration and currently running
489-
- **marketplace**: Server is from the MCP marketplace registry
490477

491478
#### Examples
492479

@@ -518,9 +505,8 @@ curl "http://localhost:3000/mcp?search=code&category=development&tags=editor&sor
518505
#### Notes
519506

520507
1. The search is case-insensitive
521-
2. Connected servers take precedence over marketplace servers in deduplication
522-
3. If marketplace is unavailable, only connected servers will be returned
523-
4. The endpoint distinguishes between search requests (with query params) and MCP protocol requests (without query params)
508+
2. Connected servers take precedence over duplicate entries
509+
3. The endpoint distinguishes between search requests (with query params) and MCP protocol requests (without query params)
524510

525511
### Health and Status
526512

@@ -739,80 +725,6 @@ Response:
739725
}
740726
```
741727

742-
### Marketplace Integration
743-
744-
#### List Available Servers
745-
746-
```bash
747-
GET /api/marketplace
748-
```
749-
750-
Query Parameters:
751-
752-
- `search`: Filter by name, description, or tags
753-
- `category`: Filter by category
754-
- `tags`: Filter by comma-separated tags
755-
- `sort`: Sort by "newest", "stars", or "name"
756-
757-
Response:
758-
759-
```json
760-
{
761-
"servers": [
762-
{
763-
"id": "example-server",
764-
"name": "Example Server",
765-
"description": "Description here",
766-
"author": "example-author",
767-
"url": "https://github.com/user/repo",
768-
"category": "search",
769-
"tags": ["search", "ai"],
770-
"stars": 100,
771-
"featured": true,
772-
"verified": true,
773-
"lastCommit": 1751257963,
774-
"updatedAt": 1751265038
775-
}
776-
],
777-
"timestamp": "2024-02-20T05:55:00.000Z"
778-
}
779-
```
780-
781-
#### Get Server Details
782-
783-
```bash
784-
POST /api/marketplace/details
785-
Content-Type: application/json
786-
787-
{
788-
"mcpId": "example-server"
789-
}
790-
```
791-
792-
Response:
793-
794-
```json
795-
{
796-
"server": {
797-
"id": "example-server",
798-
"name": "Example Server",
799-
"description": "Description here",
800-
"author": "example-author",
801-
"url": "https://github.com/user/repo",
802-
"category": "search",
803-
"tags": ["search", "ai"],
804-
"installations": [],
805-
"stars": 100,
806-
"featured": true,
807-
"verified": true,
808-
"lastCommit": 1751257963,
809-
"updatedAt": 1751265038
810-
},
811-
"readmeContent": "# Server Documentation...",
812-
"timestamp": "2024-02-20T05:55:00.000Z"
813-
}
814-
```
815-
816728
### MCP Server Operations
817729

818730
#### Execute Tool
@@ -1348,27 +1260,13 @@ All client requests follow a standardized flow:
13481260

13491261
- Node.js >= 18.0.0
13501262

1351-
## MCP Registry
1352-
1353-
MCP Hub now uses the [MCP Registry](https://github.com/ravitemer/mcp-registry) system for marketplace functionality. This provides:
1354-
1355-
- **Decentralized Server Discovery**: Registry hosted on GitHub Pages for better reliability
1356-
- **Direct GitHub Integration**: README documentation fetched directly from repositories
1357-
- **Enhanced Metadata**: Comprehensive server information including stars, categories, and installation instructions
1358-
- **Better Caching**: Improved cache system with 1-hour TTL for frequent updates
1359-
- **Fallback Support**: Automatic fallback to curl when fetch fails (useful for proxy/VPN environments)
1360-
1361-
The registry is updated regularly with new servers and improvements to existing entries.
1362-
13631263
## Todo
13641264

1365-
- [x] Implement custom marketplace rather than depending on mcp-marketplace
13661265
- [ ] TUI like mcphub.nvim
13671266
- [ ] Web UI for managing servers
13681267

13691268
### 🙏 Credits
13701269

13711270
Thanks to:
13721271

1373-
- [ravitemer/mcp-registry](https://github.com/ravitemer/mcp-registry) - For providing the MCP server marketplace endpoints that power MCP Hub's marketplace integration
13741272
- [ravitemer/mcp-hub](https://github.com/ravitemer/mcp-hub) - A centralized manager for Model Context Protocol (MCP) servers with dynamic server management and monitoring

packages/agent-infra/mcp-hub/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@agent-infra/mcp-hub",
3-
"version": "1.0.6",
3+
"version": "1.1.0",
44
"description": "A manager server for MCP servers that handles process management and tool routing",
55
"author": "Ravitemer",
66
"license": "MIT",

packages/agent-infra/mcp-hub/src/MCPConnection.ts

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -96,25 +96,6 @@ export interface DevConfig {
9696
// Transport types
9797
export type TransportType = 'stdio' | 'sse' | 'http';
9898

99-
// Interface for marketplace item
100-
export interface MarketplaceItem {
101-
mcpId: string;
102-
name?: string;
103-
description?: string;
104-
}
105-
106-
// Interface for marketplace cache
107-
export interface MarketplaceCache {
108-
catalog?: {
109-
items?: MarketplaceItem[];
110-
};
111-
}
112-
113-
// Interface for marketplace
114-
export interface Marketplace {
115-
cache?: MarketplaceCache;
116-
}
117-
11899
// Interface for server info
119100
export interface ServerInfo {
120101
name: string;
@@ -226,12 +207,7 @@ export class MCPConnection extends EventEmitter {
226207
// Dev watcher for file changes (stdio servers only)
227208
private devWatcher: DevWatcher | null;
228209

229-
constructor(
230-
name: string,
231-
config: ServerConfig,
232-
marketplace?: Marketplace,
233-
hubServerUrl?: string,
234-
) {
210+
constructor(name: string, config: ServerConfig, hubServerUrl?: string) {
235211
super();
236212
this.name = name; // Keep as mcpId
237213

@@ -243,26 +219,10 @@ export class MCPConnection extends EventEmitter {
243219
// Dev watcher for file changes (stdio servers only)
244220
this.devWatcher = null;
245221

246-
// Set display name from marketplace
247-
this.displayName = name; // Default to mcpId
248-
let serverDescription = '';
249-
if (marketplace?.cache?.catalog?.items) {
250-
const item = marketplace.cache.catalog.items.find(
251-
(item) => item.mcpId === name,
252-
);
253-
if (item?.name) {
254-
this.displayName = item.name;
255-
serverDescription = item.description || '';
256-
logger.debug(`Using marketplace name for server '${name}'`, {
257-
name,
258-
displayName: item.name,
259-
});
260-
}
261-
}
222+
// Default display name and description from config
223+
this.displayName = config.name || name;
262224
this.config = config;
263-
this.description = config.description
264-
? config.description
265-
: serverDescription;
225+
this.description = config.description || '';
266226
this.client = null;
267227
this.transport = null;
268228
this.transportType = config.type; // Store the transport type from config
@@ -902,7 +862,7 @@ export class MCPConnection extends EventEmitter {
902862
getServerInfo(): ServerInfo {
903863
return {
904864
name: this.name, // Original mcpId
905-
displayName: this.displayName, // Friendly name from marketplace
865+
displayName: this.displayName,
906866
description: this.description,
907867
transportType: this.transportType, // Include transport type in server info
908868
status: this.status,

packages/agent-infra/mcp-hub/src/MCPHub.ts

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import EventEmitter from 'events';
2020
interface MCPHubOptions {
2121
port?: number;
2222
watch?: boolean;
23-
marketplace?: any;
2423
}
2524

2625
interface ServerStartResult {
@@ -50,11 +49,10 @@ export class MCPHub extends EventEmitter {
5049
public hubServerUrl: string;
5150
public configManager: ConfigManager;
5251
public shouldWatchConfig: boolean;
53-
public marketplace?: any;
5452

5553
constructor(
5654
configPathOrObject: string | string[] | object,
57-
{ port, watch = false, marketplace }: MCPHubOptions = {},
55+
{ port, watch = false }: MCPHubOptions = {},
5856
) {
5957
super();
6058
this.connections = new Map();
@@ -65,7 +63,6 @@ export class MCPHub extends EventEmitter {
6563
watch &&
6664
(typeof configPathOrObject === 'string' ||
6765
Array.isArray(configPathOrObject));
68-
this.marketplace = marketplace;
6966
}
7067

7168
async initialize(isRestarting?: boolean): Promise<void> {
@@ -123,7 +120,6 @@ export class MCPHub extends EventEmitter {
123120
const connection = new MCPConnection(
124121
name,
125122
serverConfig,
126-
this.marketplace,
127123
this.hubServerUrl,
128124
);
129125
[
@@ -302,12 +298,7 @@ export class MCPHub extends EventEmitter {
302298
async connectServer(name: string, config: any): Promise<any> {
303299
let connection = this.getConnection(name);
304300
if (!connection) {
305-
connection = new MCPConnection(
306-
name,
307-
config,
308-
this.marketplace,
309-
this.hubServerUrl,
310-
);
301+
connection = new MCPConnection(name, config, this.hubServerUrl);
311302
this.connections.set(name, connection);
312303
}
313304
await connection.connect(config);
@@ -569,33 +560,6 @@ export class MCPHub extends EventEmitter {
569560
});
570561
}
571562

572-
// Get marketplace servers if marketplace is available
573-
if (this.marketplace) {
574-
try {
575-
const marketplaceServers = await this.marketplace.getCatalog(options);
576-
577-
// Filter out servers that are already connected (unless filtering by category/tags)
578-
const connectedNames = new Set(
579-
connectedServers.map((s) => s.name.toLowerCase()),
580-
);
581-
const uniqueMarketplace = marketplaceServers.filter(
582-
(server: any) => !connectedNames.has(server.name.toLowerCase()),
583-
);
584-
585-
// Add marketplace servers with 'available' status
586-
uniqueMarketplace.forEach((server: any) => {
587-
results.push({
588-
...server,
589-
source: 'marketplace',
590-
status: 'available',
591-
});
592-
});
593-
} catch (error: any) {
594-
logger.debug(`Failed to search marketplace: ${error.message}`);
595-
// Continue with just connected servers if marketplace fails
596-
}
597-
}
598-
599563
// Apply sorting if requested
600564
if (options.sort) {
601565
switch (options.sort) {

0 commit comments

Comments
 (0)