소스 정보
- 저장소
- tomevault-io/skills-registry
- 최근 소스 활동
- 2026년 7월 3일 19:45
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill v3-mcp-optimization명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | v3-mcp-optimization |
| description | name: "V3 MCP Optimization" Use when this capability is needed. |
Optimizes claude-flow v3 MCP (Model Context Protocol) server implementation with advanced transport layer optimizations, connection pooling, load balancing, and comprehensive performance monitoring to achieve sub-100ms response times.
# Initialize MCP optimization analysis
Task("MCP architecture", "Analyze current MCP server performance and bottlenecks", "mcp-specialist")
# Optimization implementation (parallel)
Task("Connection pooling", "Implement MCP connection pooling and reuse", "mcp-specialist")
Task("Load balancing", "Add dynamic load balancing for MCP tools", "mcp-specialist")
Task("Transport optimization", "Optimize transport layer performance", "mcp-specialist")
Current MCP Issues:
├── Cold Start Latency: ~1.8s MCP server init
├── Connection Overhead: New connection per request
├── Tool Registry: Linear search O(n) for 213+ tools
├── Transport Layer: No connection reuse
└── Memory Usage: No cleanup of idle connections
Target Performance:
├── Startup Time: <400ms (4.5x improvement)
├── Tool Lookup: <5ms (O(1) hash table)
├── Connection Reuse: 90%+ connection pool hits
├── Response Time: <100ms p95
└── Memory Efficiency: 50% reduction
// src/core/mcp/mcp-server.ts
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
interface OptimizedMCPConfig {
// Connection pooling
maxConnections: number;
idleTimeoutMs: number;
connectionReuseEnabled: boolean;
// Tool registry
toolCacheEnabled: boolean;
toolIndexType: 'hash' | 'trie';
// Performance
requestTimeoutMs: number;
batchingEnabled: boolean;
compressionEnabled: boolean;
// Monitoring
metricsEnabled: boolean;
healthCheckIntervalMs: number;
}
export class OptimizedMCPServer {
private server: Server;
private connectionPool: ConnectionPool;
private toolRegistry: FastToolRegistry;
private loadBalancer: ;
: ;
() {
. = ({
: ,
:
}, {
: {
: { : },
: { : , : },
: { : }
}
});
. = (config);
. = (config.);
. = ();
. = (config.);
}
(): <> {
..();
..();
.();
.();
transport = ();
..(transport);
..();
}
}
// src/core/mcp/connection-pool.ts
interface PooledConnection {
id: string;
connection: MCPConnection;
lastUsed: number;
usageCount: number;
isHealthy: boolean;
}
export class ConnectionPool {
private pool: Map<string, PooledConnection> = new Map();
private readonly config: ConnectionPoolConfig;
private healthChecker: HealthChecker;
constructor(config: ConnectionPoolConfig) {
this.config = {
maxConnections: 50,
minConnections: 5,
idleTimeoutMs: 300000, // 5 minutes
maxUsageCount: 1000,
healthCheckIntervalMs: 30000,
...config
};
this.healthChecker = new HealthChecker(this..);
}
(: ): <> {
start = performance.();
pooled = .(endpoint);
(pooled) {
pooled. = .();
pooled.++;
.(, performance.() - start);
pooled.;
}
(.. >= ..) {
.();
}
connection = .(endpoint);
: = {
: .(),
connection,
: .(),
: ,
:
};
..(pooledConn., pooledConn);
.(, performance.() - start);
connection;
}
(: ): <> {
pooled = .(connection.);
(pooled) {
(pooled. >= ..) {
.(pooled.);
}
}
}
(): <> {
: <>[] = [];
( i = ; i < ..; i++) {
connections.(.());
}
.(connections);
}
(): <> {
: | = ;
oldestTime = .();
( conn ..()) {
(conn. < oldestTime) {
oldestTime = conn.;
oldestConn = conn;
}
}
(oldestConn) {
.(oldestConn.);
}
}
(: ): | {
( conn ..()) {
(conn. &&
conn.. === endpoint &&
.() - conn. < ..) {
conn;
}
}
;
}
}
// src/core/mcp/fast-tool-registry.ts
interface ToolIndexEntry {
name: string;
handler: ToolHandler;
metadata: ToolMetadata;
usageCount: number;
avgLatencyMs: number;
}
export class FastToolRegistry {
private toolIndex: Map<string, ToolIndexEntry> = new Map();
private categoryIndex: Map<string, string[]> = new Map();
private fuzzyMatcher: FuzzyMatcher;
private cache: LRUCache<string, ToolIndexEntry>;
constructor(indexType: 'hash' | 'trie' = 'hash') {
this.fuzzyMatcher = new FuzzyMatcher();
this.cache = new LRUCache<string, >();
}
(): <> {
start = performance.();
tools = .();
( tool tools) {
: = {
: tool.,
: tool.,
: tool.,
: ,
:
};
..(tool., entry);
category = tool.. || ;
(!..(category)) {
..(category, []);
}
..(category)!.(tool.);
}
..(tools.( t.));
.();
}
(: ): | {
cached = ..(name);
(cached) cached;
exact = ..(name);
(exact) {
..(name, exact);
exact;
}
fuzzyMatches = ..(name, );
(fuzzyMatches. > ) {
match = ..(fuzzyMatches[]);
(match) {
..(name, match);
match;
}
}
;
}
(: ): [] {
toolNames = ..(category) || [];
toolNames
.( ..(name))
.( entry !== ) [];
}
(: = ): [] {
.(..())
.( b. - a.)
.(, limit);
}
(: , : ): {
entry = ..(toolName);
(entry) {
entry.++;
entry. = (entry. + latencyMs) / ;
}
}
}
// src/core/mcp/load-balancer.ts
interface ServerInstance {
id: string;
endpoint: string;
load: number;
responseTime: number;
isHealthy: boolean;
maxConnections: number;
currentConnections: number;
}
export class MCPLoadBalancer {
private servers: Map<string, ServerInstance> = new Map();
private routingStrategy: RoutingStrategy = 'least-connections';
addServer(server: ServerInstance): void {
this.servers.set(server.id, server);
}
selectServer(toolCategory?: string): ServerInstance | null {
const healthyServers = Array.from(this.servers.values())
.filter( server.);
(healthyServers. === ) ;
(.) {
:
.(healthyServers);
:
.(healthyServers);
:
.(healthyServers);
:
.(healthyServers, toolCategory);
:
healthyServers[];
}
}
(: []): {
servers.(
current. < least. ? current : least
);
}
(: []): {
servers.(
current. < fastest. ? current : fastest
);
}
(: [], ?: ): {
scored = servers.( ({
server,
: .(server, category)
}));
scored.( b. - a.);
scored[].;
}
(: , ?: ): {
loadFactor = - (server. / server.);
responseFactor = / (server. + );
categoryBonus = .(server, category);
loadFactor * + responseFactor * + categoryBonus * ;
}
(: , : <>): {
server = ..(serverId);
(server) {
.(server, metrics);
}
}
}
// src/core/mcp/optimized-transport.ts
export class OptimizedTransport {
private compression: boolean = true;
private batching: boolean = true;
private batchBuffer: MCPMessage[] = [];
private batchTimeout: NodeJS.Timeout | null = null;
constructor(private config: TransportConfig) {}
async send(message: MCPMessage): Promise<void> {
if (this.batching && this.canBatch(message)) {
this.addToBatch(message);
return;
}
await this.sendImmediate(message);
}
private async sendImmediate(message: MCPMessage): Promise<void> {
const start = performance.();
payload = .
? .(message)
: message;
..(payload);
.(performance.() - start);
}
(: ): {
..(message);
(!.) {
. = (
.(),
.. ||
);
}
(.. >= ..) {
.();
}
}
(): <> {
(.. === ) ;
batch = ..();
. = ;
.({
: ,
: batch
});
}
(: ): {
message. !== &&
message. !== &&
message. !== ;
}
(: ): <> {
(.(data));
}
}
// src/core/mcp/metrics.ts
interface MCPMetrics {
requestCount: number;
errorCount: number;
avgResponseTime: number;
p95ResponseTime: number;
connectionPoolHits: number;
connectionPoolMisses: number;
toolLookupTime: number;
startupTime: number;
}
export class MCPMetricsCollector {
private metrics: MCPMetrics;
private responseTimeBuffer: number[] = [];
private readonly bufferSize = 1000;
constructor() {
this.metrics = this.createInitialMetrics();
}
recordRequest(latencyMs: number): void {
this.metrics.requestCount++;
this.updateResponseTimes(latencyMs);
}
recordError(): void {
this.metrics.errorCount++;
}
(): {
..++;
}
(): {
..++;
}
(: ): {
.. = .(
..,
latencyMs
);
}
(: ): {
.. = latencyMs;
}
(): {
{ .... };
}
(): {
errorRate = .. / ..;
poolHitRate = .. /
(.. + ..);
{
: .(errorRate, poolHitRate),
errorRate,
poolHitRate,
: ..,
: ..
};
}
(: ): {
..(latency);
(.. > .) {
..();
}
.. = .(.);
.. = .(., );
}
(: [], : ): {
sorted = arr.().( a - b);
index = .((percentile / ) * sorted.) - ;
sorted[index] || ;
}
(: , : ): | | {
(errorRate > || poolHitRate < ) ;
(errorRate > || poolHitRate < ) ;
;
}
}
// src/core/mcp/tool-precompiler.ts
export class ToolPrecompiler {
async precompileTools(): Promise<CompiledToolRegistry> {
const tools = await this.loadAllTools();
// Create optimized lookup structures
const nameIndex = new Map<string, Tool>();
const categoryIndex = new Map<string, Tool[]>();
const fuzzyIndex = new Map<string, string[]>();
for (const tool of tools) {
// Exact name index
nameIndex.set(tool.name, tool);
// Category index
const category = tool.metadata.category || 'general';
if (!categoryIndex.has(category)) {
categoryIndex.set(category, []);
}
categoryIndex.get(category)!.push(tool);
// Pre-compute fuzzy variations
const variations = this.generateFuzzyVariations(tool.);
( variation variations) {
(!fuzzyIndex.(variation)) {
fuzzyIndex.(variation, []);
}
fuzzyIndex.(variation)!.(tool.);
}
}
{
nameIndex,
categoryIndex,
fuzzyIndex,
: tools.,
: ()
};
}
(: ): [] {
: [] = [];
variations.(name.());
variations.(name.(, ));
variations.(name.(, ));
variations;
}
}
// src/core/mcp/multi-level-cache.ts
export class MultiLevelCache {
private l1Cache: Map<string, any> = new Map(); // In-memory, fastest
private l2Cache: LRUCache<string, any>; // LRU cache, larger capacity
private l3Cache: DiskCache; // Persistent disk cache
constructor(config: CacheConfig) {
this.l2Cache = new LRUCache<string, any>({
max: config.l2MaxEntries || 10000,
ttl: config.l2TTL || 300000 // 5 minutes
});
this.l3Cache = new DiskCache(config.l3Path || './.cache/mcp');
}
async get(key: string): Promise<any | null> {
// Try L1 cache first (fastest)
(..(key)) {
..(key);
}
l2Value = ..(key);
(l2Value) {
..(key, l2Value);
l2Value;
}
l3Value = ..(key);
(l3Value) {
..(key, l3Value);
..(key, l3Value);
l3Value;
}
;
}
(: , : , ?: ): <> {
..(key, value);
..(key, value);
(options?.) {
..(key, value);
}
(.. > ) {
firstKey = ..().().;
..(firstKey);
}
}
}
const mcpDashboard = {
metrics: [
'Request latency (p50, p95, p99)',
'Error rate by tool category',
'Connection pool utilization',
'Tool lookup performance',
'Memory usage trends',
'Cache hit rates (L1, L2, L3)'
],
alerts: [
'Response time >200ms for 5 minutes',
'Error rate >5% for 1 minute',
'Pool hit rate <70% for 10 minutes',
'Memory usage >500MB for 5 minutes'
]
};
v3-core-implementation - Core domain integration with MCPv3-performance-optimization - Overall performance optimizationv3-swarm-coordination - MCP integration with swarm coordinationv3-memory-unification - Memory sharing via MCP tools# Full MCP server optimization
Task("MCP optimization implementation",
"Implement all MCP performance optimizations with monitoring",
"mcp-specialist")
# Connection pool optimization
Task("MCP connection pooling",
"Implement advanced connection pooling with health monitoring",
"mcp-specialist")
Source: frankxai/arcanea — distributed by TomeVault.