github / github/github-mcp-server

perf: integrate go-sdk schema caching optimization (Phase 1)

オープン
#1,530 コメント 0 件 リアクション 1 件 担当者 1 名 @Copilot に割り当て済み GitHub で見る
enhancement performance
主要言語
Go
スター
33k
フォーク
5k
平均マージ
2日 1時間
マージ済み PR(30日)
52

説明

## Summary

Integrate the schema caching optimization from the go-sdk fork to dramatically improve tool registration performance.

## Background

The go-sdk currently performs expensive reflection-based schema generation on every `AddTool` call. In stateless server patterns (like github-mcp-server where a new server is created per HTTP request), this causes significant overhead.

The optimization adds automatic schema caching that provides:
- **132x faster** tool registration
- **51x fewer** allocations
- **19% faster** per-tool-call validation

## Implementation

### 1. Update go.mod to use the fork

Add a replace directive to use the optimized fork:

```go
replace github.com/modelcontextprotocol/go-sdk => github.com/SamMorrowDrums/go-sdk v0.0.0-20251204132239-46310a70a79a
```

Or use the branch reference:
```go
replace github.com/modelcontextprotocol/go-sdk => github.com/SamMorrowDrums/go-sdk perf/phase1-schema-cache
```

### 2. Run go mod tidy

```bash
go mod tidy
```

### 3. Verify all tests pass

```bash
go test ./...
```

## Expected Impact

No code changes should be required in github-mcp-server. The optimization is automatic and transparent to integrators.

## Fork Branch

- Repository: https://github.com/SamMorrowDrums/go-sdk
- Branch: `perf/phase1-schema-cache`
- PR: https://github.com/SamMorrowDrums/go-sdk/pull/1

## Benchmark Results

```
BenchmarkAddTool_TypedHandler-22 977080 1223 ns/op 1208 B/op 21 allocs/op
BenchmarkAddTool_TypedHandler_NoCache-22 6764 161463 ns/op 39262 B/op 1072 allocs/op
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。