Skip to content

Commit 431a670

Browse files
domdomeggclaude
andauthored
Consolidate documentation and remove redundancy (#222)
## Summary This PR consolidates our documentation to reduce redundancy and maintenance overhead: - Removes the CLAUDE.md file with Import statement in favor of direct README.md usage - Merges CONTRIBUTING.md content into README.md's Contributing section - Migrates useful architecture and developer information from the old CLAUDE.md to README.md - Eliminates duplicated information between files ## Benefits - Single source of truth in README.md reduces documentation drift - Easier maintenance with all docs in one place - Claude Code remains fully functional while reducing complexity 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent f5bf542 commit 431a670

File tree

3 files changed

+68
-209
lines changed

3 files changed

+68
-209
lines changed

CLAUDE.md

Lines changed: 2 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,4 @@
11
# CLAUDE.md
2+
_Guidance for Claude Code (claude.ai/code) when working in this repository. If it's also useful to humans (probably most things!), put the instructions in README.md instead._
23

3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4-
5-
## Overview
6-
MCP Registry is a community-driven registry service for Model Context Protocol (MCP) servers. It provides a centralized repository for discovering and managing MCP implementations.
7-
8-
## Development Setup
9-
10-
### Prerequisites
11-
- **Go 1.23.x** - The project requires this specific version (check with `go version`)
12-
- Consider using a Go version manager like `g` or `gvm` if you work on multiple projects
13-
- **golangci-lint v2.3.1** - Install with:
14-
```bash
15-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.3.1
16-
```
17-
18-
### Git Hooks (Optional)
19-
To run linting automatically before commits:
20-
```bash
21-
git config core.hooksPath .githooks
22-
```
23-
24-
## Common Development Commands
25-
26-
### Build
27-
```bash
28-
# Build the registry application
29-
go build ./cmd/registry
30-
31-
# Build with Docker
32-
docker build -t registry .
33-
34-
# Build the publisher tool
35-
cd tools/publisher && ./build.sh
36-
```
37-
38-
### Run
39-
```bash
40-
# Development with Docker Compose (recommended)
41-
docker compose up
42-
43-
# Direct execution
44-
go run cmd/registry/main.go
45-
```
46-
47-
### Test
48-
```bash
49-
# Unit tests
50-
go test -v -race -coverprofile=coverage.out -covermode=atomic ./internal/...
51-
52-
# Integration tests
53-
./tests/integration/run.sh
54-
55-
# Test API endpoints
56-
./scripts/test_endpoints.sh
57-
58-
# Test publish endpoint (requires GitHub token)
59-
export BEARER_TOKEN=your_github_token_here
60-
./scripts/test_publish.sh
61-
```
62-
63-
### Lint
64-
```bash
65-
# Run linting (same as CI)
66-
golangci-lint run --timeout=5m
67-
68-
# Check formatting
69-
gofmt -s -l .
70-
71-
# Fix formatting issues
72-
gofmt -s -w .
73-
```
74-
75-
**Note**: The project uses golangci-lint v2.3.1 with 62 enabled linters. Always run linting locally before pushing to avoid CI failures.
76-
77-
## Architecture Overview
78-
79-
The codebase follows a clean architecture pattern:
80-
81-
### Core Layers
82-
- **API Layer** (`internal/api/`) - HTTP handlers and routing
83-
- **Service Layer** (`internal/service/`) - Business logic implementation
84-
- **Database Layer** (`internal/database/`) - Data persistence abstraction with MongoDB and in-memory implementations
85-
- **Domain Models** (`internal/model/`) - Core data structures
86-
- **Authentication** (`internal/auth/`) - GitHub OAuth integration
87-
88-
### Request Flow
89-
1. HTTP requests enter through router (`internal/api/router/`)
90-
2. Handlers in `internal/api/handlers/v0/` validate and process requests
91-
3. Service layer executes business logic
92-
4. Database interface handles persistence
93-
5. JSON responses returned to clients
94-
95-
### Key Interfaces
96-
- **Database Interface** (`internal/database/database.go`) - Abstracts data persistence with MongoDB and memory implementations
97-
- **RegistryService** (`internal/service/service.go`) - Business logic abstraction over database
98-
- **Auth Service** (`internal/auth/auth.go`) - GitHub OAuth token validation
99-
100-
### Authentication Flow
101-
Publishing requires GitHub OAuth validation:
102-
1. Extract bearer token from Authorization header
103-
2. Validate token with GitHub API
104-
3. Verify repository ownership matches token owner
105-
4. Check organization membership if applicable
106-
107-
### Design Patterns
108-
- **Factory Pattern** for service creation with dependency injection
109-
- **Repository Pattern** for database abstraction
110-
- **Context Pattern** for timeout management (5-second DB operations)
111-
- **Cursor-based Pagination** using UUIDs for stateless pagination
112-
113-
## Environment Variables
114-
Key configuration for development:
115-
- `MCP_REGISTRY_DATABASE_URL` (default: `mongodb://localhost:27017`)
116-
- `MCP_REGISTRY_GITHUB_CLIENT_ID`
117-
- `MCP_REGISTRY_GITHUB_CLIENT_SECRET`
118-
- `MCP_REGISTRY_LOG_LEVEL` (default: `info`)
119-
- `MCP_REGISTRY_SERVER_ADDRESS` (default: `:8080`)
120-
- `MCP_REGISTRY_SEED_IMPORT` (default: `true`)
121-
- `MCP_REGISTRY_SEED_FILE_PATH` (default: `data/seed.json`)
4+
Import @README.md

CONTRIBUTING.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 66 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ A community driven registry service for Model Context Protocol (MCP) servers.
44

55
## Development Status
66

7-
This project is being built in the open and is currently in the early stages of development. Please see the [overview discussion](https://github.com/modelcontextprotocol/registry/discussions/11) for the project scope and goals. If you would like to contribute, please check out the [contributing guidelines](CONTRIBUTING.md).
7+
This project is being built in the open and is currently in the early stages of development. Please see the [overview discussion](https://github.com/modelcontextprotocol/registry/discussions/11) for the project scope and goals.
8+
9+
### Contributing
10+
11+
Use [Discussions](https://github.com/modelcontextprotocol/registry/discussions) to propose and discuss product and/or technical **requirements**.
12+
13+
Use [Issues](https://github.com/modelcontextprotocol/registry/issues) to track **well-scoped technical work** that the community agrees should be done at some point.
14+
15+
Open [Pull Requests](https://github.com/modelcontextprotocol/registry/pulls) when you want to **contribute work towards an Issue**, or you feel confident that your contribution is desireable and small enough to forego community discussion at the requirements and planning levels.
816

917
## Overview
1018

@@ -43,19 +51,32 @@ The easiest way to get the registry running is uses docker compose. This will se
4351
make dev-compose
4452
```
4553

46-
This will start the MCP Registry service and MongoDB with Docker, exposing it on port 8080.
54+
This will start the MCP Registry service and MongoDB with Docker, running at [`localhost:8080`](http://localhost:8080).
4755

4856
## Building
4957

50-
If you prefer to run the service locally without Docker, you can build and run it directly using Go.
58+
If you prefer to run the service locally without Docker, you can build and run it directly:
5159

5260
```bash
5361
# Build a registry executable
5462
make build
5563
```
5664
This will create the `registry` binary in the current directory. You'll need to have MongoDB running locally or with Docker.
5765

58-
By default, the service will run on `http://localhost:8080`.
66+
To run the service locally:
67+
```bash
68+
# Run registry locally (requires MongoDB)
69+
make dev-local
70+
```
71+
72+
By default, the service will run on [`localhost:8080`](http://localhost:8080).
73+
74+
To build the CLI tool for publishing MCP servers to the registry:
75+
76+
```bash
77+
# Build the publisher tool
78+
make publisher
79+
```
5980

6081
## Development
6182

@@ -70,14 +91,14 @@ make help
7091
Key development commands:
7192

7293
```bash
73-
# Build targets
74-
make build # Build the registry application
75-
make publisher # Build the publisher tool
76-
7794
# Development
7895
make dev-compose # Start development environment with Docker Compose
7996
make dev-local # Run registry locally (requires MongoDB)
8097

98+
# Build targets
99+
make build # Build the registry application
100+
make publisher # Build the publisher tool
101+
81102
# Testing
82103
make test-unit # Run unit tests with coverage report
83104
make test-integration # Run integration tests
@@ -123,35 +144,62 @@ git config core.hooksPath .githooks
123144

124145
This will prevent commits that fail linting or have formatting issues.
125146

126-
## Project Structure
147+
### Project Structure
127148

128149
```
129150
├── api/ # OpenApi specification
130151
├── cmd/ # Application entry points
131152
├── config/ # Configuration files
132153
├── internal/ # Private application code
133-
│ ├── api/ # HTTP server and request handlers
154+
│ ├── api/ # HTTP server and request handlers (routing)
155+
│ ├── auth/ # GitHub OAuth integration
134156
│ ├── config/ # Configuration management
135-
│ ├── model/ # Data models
136-
│ └── service/ # Business logic
157+
│ ├── database/ # Data persistence abstraction (MongoDB and in-memory)
158+
│ ├── model/ # Data models and domain structures
159+
│ └── service/ # Business logic implementation
137160
├── pkg/ # Public libraries
138161
├── scripts/ # Utility scripts
139162
└── tools/ # Command line tools
140163
└── publisher/ # Tool to publish MCP servers to the registry
141164
```
142165

143-
## API Documentation
166+
### Architecture Overview
144167

145-
The API is documented using Swagger/OpenAPI. You can access the interactive Swagger UI at:
168+
### Request Flow
169+
1. HTTP requests enter through router (`internal/api/router/`)
170+
2. Handlers in `internal/api/handlers/v0/` validate and process requests
171+
3. Service layer executes business logic
172+
4. Database interface handles persistence
173+
5. JSON responses returned to clients
146174

147-
```
148-
/v0/swagger/index.html
149-
```
175+
### Key Interfaces
176+
- **Database Interface** (`internal/database/database.go`) - Abstracts data persistence with MongoDB and memory implementations
177+
- **RegistryService** (`internal/service/service.go`) - Business logic abstraction over database
178+
- **Auth Service** (`internal/auth/auth.go`) - GitHub OAuth token validation
179+
180+
### Authentication Flow
181+
Publishing requires GitHub OAuth validation:
182+
1. Extract bearer token from Authorization header
183+
2. Validate token with GitHub API
184+
3. Verify repository ownership matches token owner
185+
4. Check organization membership if applicable
150186

151-
This provides a complete reference of all endpoints with request/response schemas and allows you to test the API directly from your browser.
187+
### Design Patterns
188+
- **Factory Pattern** for service creation with dependency injection
189+
- **Repository Pattern** for database abstraction
190+
- **Context Pattern** for timeout management (5-second DB operations)
191+
- **Cursor-based Pagination** using UUIDs for stateless pagination
152192

153193
## API Endpoints
154194

195+
### API Documentation
196+
197+
```
198+
GET /v0/swagger/index.html
199+
```
200+
201+
The API is documented using Swagger/OpenAPI. This page provides a complete reference of all endpoints with request/response schemas and allows you to test the API directly from your browser.
202+
155203
### Health Check
156204

157205
```
@@ -369,71 +417,6 @@ The service can be configured using environment variables:
369417
| `MCP_REGISTRY_SEED_IMPORT` | Import `seed.json` on first run | `true` |
370418
| `MCP_REGISTRY_SERVER_ADDRESS` | Listen address for the server | `:8080` |
371419

372-
373-
## Testing
374-
375-
### Unit Tests
376-
377-
```bash
378-
# Run unit tests with coverage
379-
make test
380-
381-
# Generate coverage report
382-
make coverage
383-
```
384-
385-
### Integration Tests
386-
387-
```bash
388-
# Run integration tests
389-
make integration-test
390-
```
391-
392-
### API Endpoint Testing
393-
394-
```bash
395-
# Test API endpoints (requires running server)
396-
make test-endpoints
397-
```
398-
399-
You can also run the script directly with specific endpoints:
400-
401-
```bash
402-
./scripts/test_endpoints.sh --endpoint health
403-
./scripts/test_endpoints.sh --endpoint servers
404-
```
405-
406-
### Publish Endpoint Testing
407-
408-
```bash
409-
# Test publish endpoint (requires BEARER_TOKEN env var)
410-
make test-publish
411-
```
412-
413-
### Validation
414-
415-
```bash
416-
# Validate JSON schemas
417-
make validate-schemas
418-
419-
# Validate examples against schemas
420-
make validate-examples
421-
422-
# Run all validation checks
423-
make validate
424-
```
425-
426-
### Comprehensive Testing
427-
428-
```bash
429-
# Run all checks (lint, validate, test)
430-
make check
431-
```
432-
433420
## License
434421

435422
See the [LICENSE](LICENSE) file for details.
436-
437-
## Contributing
438-
439-
See the [CONTRIBUTING](CONTRIBUTING.md) file for details.

0 commit comments

Comments
 (0)