| Filename | Latest commit message | Latest commit date |
|---|---|---|
## Summary Fixes #663 - **Security fix**: `mcp-publisher login` no longer writes `.mcpregistry_github_token` and `.mcpregistry_registry_token` to the current working directory. GitHub tokens are kept in memory during the login→exchange flow and cleared immediately after. - **Token location**: Unified token moved from `~/.mcp_publisher_token` to `~/.config/mcp-publisher/token.json` (dir 0700, file 0600), following the convention used by `gh`, `docker`, and `kubectl`. - **Dead code removed**: `NeedsLogin()` was on the `Provider` interface but never called — removed from interface and all 4 implementations. `forceLogin` field also removed. - **Auth tests added**: 11 new tests for `GitHubATProvider` (package previously had 0 tests). - **Test isolation**: `SetupTestToken` now uses `t.TempDir()` + `t.Setenv("HOME", ...)` instead of writing to real `$HOME`. ### Breaking change Users must re-login after upgrading (`mcp-publisher login <method>`). Existing tokens at `~/.mcp_publisher_token` are not auto-migrated. `logout` cleans up both old and new locations. ## Test plan - [x] `make check` passes (lint, unit tests, integration tests) - [x] `mcp-publisher login none` stores token at `~/.config/mcp-publisher/token.json` - [x] No `.mcpregistry_*` files created in cwd after login (with `--token`, `MCP_GITHUB_TOKEN`, or device flow) - [x] `mcp-publisher publish` reads token from new location - [x] `mcp-publisher validate` reads registry URL from new location - [x] `mcp-publisher logout` cleans up new location, legacy `~/.mcp_publisher_token`, and cwd `.mcpregistry_*` files - [x] `mcp-publisher logout` when not logged in shows "Not logged in" - [x] File permissions: dir 0700, file 0600 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
| .. | ||
| docker-compose.integration-test.yml | ||
| main.go | ||
| README.md | ||
| run.sh | ||
Integration Test
This directory contains an end-to-end test for publishing to the registry.
What the Test Covers
- Publisher Tool: Tests the
publisherCLI that publishes metadata to the registry - Registry API: Validates the
/v0/publishand/v0/servers/{server_id}endpoints work correctly - Example Validation: Ensures all example JSON in
docs/reference/server-json/generic-server-json.mdis valid and can be published - Data Consistency: Verifies published data matches what's retrieved from the registry
Test Flow
- Build: Build
publisherandregistry - Start Services: Launch registry and MongoDB using Docker Compose with test configuration
- Publish Examples: Extract JSON examples from documentation and run
publisherto publish each one - Validate Responses: GET each published server from the registry and compare it to the example JSON
- Cleanup: Stop Docker containers and remove temporary files
How to Run
Prerequisites
- Docker and Docker Compose
- Go 1.24
- Make sure you're in the repository root directory
Run the Tests
./tests/integration/run.sh
Note: Integration tests use isolated container names (registry-integration-test, postgres-integration-test) to prevent conflicts with development containers from make dev-compose.