Skip to content

Latest commit

 

History

History
476 lines (345 loc) · 14 KB

File metadata and controls

476 lines (345 loc) · 14 KB

Documentation Audit Report

Date: 2025-11-16 Auditor: Claude (AI Assistant) Project: osmmcp - OpenStreetMap MCP Server

Executive Summary

This audit reviews all project documentation for accuracy, completeness, and alignment with the current codebase. Overall, the documentation is well-maintained with a few critical inaccuracies and outdated information that need attention.

Overall Assessment: 🟡 Good with Issues Critical Issues: 3 Minor Issues: 5 Outdated Documents: 1


Documentation Inventory

Active Documentation Files

  1. README.md - Main project documentation
  2. CLAUDE.md - Developer/AI assistant guidance
  3. TRACING.md - OpenTelemetry tracing documentation
  4. CONTRIBUTORS.md - Contributor list
  5. pkg/osm/README.md - OSM package documentation
  6. pkg/tools/docs/geocoding.md - Geocoding tools guide
  7. pkg/tools/docs/ai_prompts.md - AI integration prompts

Planning/Design Documents

  1. docs/tool_prompt_pattern.md - Pattern documentation
  2. docs/refactoring.md - Refactoring notes

Status Documents

  1. MCP_TRANSPORT_STANDARDIZATION_ANALYSIS.md - Transport analysis ⚠️ OUTDATED

Critical Issues

🚨 Issue 1: Tool Count Discrepancy (CRITICAL)

Locations: README.md, CLAUDE.md, pkg/tools documentation

Problem:

  • CLAUDE.md line 13 claims: "30+ OSM-specific tools"
  • README.md line 329 claims: "14 tools" in project structure
  • Actual count: 25 tools registered in pkg/tools/registry.go

Registered Tools (25):

  1. get_version
  2. geocode_address
  3. reverse_geocode
  4. get_map_image
  5. route_fetch
  6. get_route_directions
  7. suggest_meeting_point
  8. route_sample
  9. analyze_commute
  10. find_nearby_places
  11. explore_area
  12. find_parking_facilities
  13. find_charging_stations
  14. find_schools_nearby
  15. analyze_neighborhood
  16. geo_distance
  17. bbox_from_points
  18. centroid_points
  19. polyline_decode
  20. polyline_encode
  21. enrich_emissions
  22. osm_query_bbox
  23. filter_tags
  24. sort_by_distance
  25. tile_cache

Unregistered Tools (Exist in Code but NOT Registered):

  • find_route_charging_stations (mentioned in README.md table line 56)
  • get_route (mentioned in README.md table line 51)
  • search_category (mentioned in README.md table line 50)

These tools exist in the codebase (pkg/tools/) but are NOT added to the registry, so they're not actually available to users!

Recommendation:

  1. EITHER: Register the 3 missing tools in registry.go → brings total to 28 tools
  2. OR: Remove them from README.md table and mark as deprecated
  3. Update CLAUDE.md to say "25 tools" (or 28 if registered)
  4. Update README.md project structure section to say "25 tools" (or 28)

🚨 Issue 2: Package Structure Incomplete (CRITICAL)

Location: README.md lines 326-335

Current Documentation:

- `pkg/server` - MCP server implementation
- `pkg/tools` - OpenStreetMap tool implementations and tool registry (14 tools)
- `pkg/osm` - OpenStreetMap API clients, rate limiting, polyline encoding, and utilities
- `pkg/geo` - Geographic types, bounding boxes, and Haversine distance calculations
- `pkg/cache` - TTL-based caching layer for API responses (5-minute default)
- `pkg/testutil` - Testing utilities and helpers
- `pkg/version` - Build metadata and version information

Missing Packages:

  • pkg/core - CRITICAL OMISSION - Core utilities including HTTP retry logic, validation, error handling, Overpass query builder, OSRM service client (mentioned extensively in CLAUDE.md)
  • pkg/monitoring - CRITICAL OMISSION - Prometheus metrics, health checking, connection monitoring (mentioned in CLAUDE.md and TRACING.md)
  • pkg/tracing - OpenTelemetry tracing support (mentioned in TRACING.md)

Recommendation: Add the three missing packages to README.md project structure section with descriptions from CLAUDE.md.


🚨 Issue 3: Outdated Transport Analysis Document (CRITICAL)

Location: MCP_TRANSPORT_STANDARDIZATION_ANALYSIS.md

Problem: This document (dated 2025-11-12) states that dual transport support is "BROKEN" (line 22):

Dual Transport (stdio + HTTP):BROKEN - Currently mutually exclusive

However, the current code in cmd/osmmcp/main.go (lines 242-286) shows this has been FIXED:

  • HTTP transport runs in a goroutine (non-blocking) when --enable-http is set
  • stdio transport ALWAYS runs on the main thread
  • Both operate simultaneously

Status in Document: "80% compliant" Actual Status: Likely 95%+ compliant (dual transport is now working)

Recommendation:

  1. Archive this document to docs/archive/ or add a clear "RESOLVED" banner at the top
  2. Update to reflect that the critical dual transport issue has been fixed
  3. Re-test the remaining minor health check format issues (if still relevant)

Minor Issues

Issue 4: Go Version Consistency ✅ ACCURATE

Locations: README.md line 220, go.mod line 3

Both correctly state: Go 1.24 or higher


Issue 5: Rate Limit Descriptions ✅ ACCURATE

Location: README.md lines 249-252, pkg/osm/ratelimit.go

Documentation states:

  • Nominatim: 1 rps, burst 1
  • Overpass: 2 per minute (0.033 rps), burst 2
  • OSRM: 100 per minute (1.67 rps), burst 5

Code confirms:

// Nominatim: 1 request per second
limiters[ServiceNominatim] = rate.NewLimiter(rate.Every(1*time.Second), 1)

// Overpass: 2 requests per minute
limiters[ServiceOverpass] = rate.NewLimiter(rate.Every(30*time.Second), 2)

// OSRM: 100 requests per minute
limiters[ServiceOSRM] = rate.NewLimiter(rate.Every(600*time.Millisecond), 5)

Status: ✅ Accurate


Issue 6: External Service URLs ✅ ACCURATE

Location: README.md line 313-320

Documentation states:

  • Nominatim - For geocoding operations
  • Overpass API - For OpenStreetMap data queries
  • OSRM - For routing calculations

Code confirms (pkg/osm/util.go):

NominatimBaseURL = "https://nominatim.openstreetmap.org"
OverpassBaseURL  = "https://overpass-api.de/api/interpreter"
OSRMBaseURL      = "https://router.project-osrm.org"

Status: ✅ Accurate


Issue 7: Command-Line Flags ✅ MOSTLY ACCURATE

Location: CLAUDE.md lines 36-67, cmd/osmmcp/main.go

All documented flags exist and match the code:

  • --debug
  • --version
  • --generate-config
  • --user-agent
  • --enable-http
  • --http-addr ✅ (default: ":7082")
  • --http-base-url
  • --http-auth-type ✅ (none/bearer/basic)
  • --http-auth-token
  • --enable-monitoring ✅ (default: true)
  • --monitoring-addr ✅ (default: ":9090")
  • --nominatim-rps, --nominatim-burst
  • --overpass-rps, --overpass-burst
  • --osrm-rps, --osrm-burst

Undocumented flag:

  • --merge-only (line 60 in main.go) - Not mentioned in CLAUDE.md

Recommendation: Add --merge-only to CLAUDE.md flag documentation.


Issue 8: Monitoring Metrics ✅ ACCURATE

Location: CLAUDE.md lines 314-328, pkg/monitoring/metrics.go

All documented metrics exist in the code:

  • osmmcp_mcp_requests_total
  • osmmcp_mcp_request_duration_seconds
  • osmmcp_external_service_requests_total
  • osmmcp_external_service_request_duration_seconds
  • osmmcp_rate_limit_exceeded_total
  • osmmcp_rate_limit_wait_duration_seconds
  • osmmcp_cache_hits_total / osmmcp_cache_misses_total
  • osmmcp_cache_size
  • osmmcp_active_connections
  • osmmcp_errors_total
  • osmmcp_goroutines
  • osmmcp_memory_usage_bytes
  • osmmcp_system_info

Status: ✅ Comprehensive and accurate


Issue 9: Architecture Claims ✅ MOSTLY ACCURATE

Location: CLAUDE.md lines 22-34, README.md lines 183-202

Documented Architecture:

  1. MCP Server Layer (pkg/server/) ✅
  2. Tools Layer (pkg/tools/) ✅
  3. Core Utilities (pkg/core/) ✅ (missing from README.md)
  4. OSM Integration (pkg/osm/) ✅
  5. Caching Layer (pkg/cache/) ✅
  6. Monitoring Layer (pkg/monitoring/) ✅ (missing from README.md)

Design Patterns (all verified in code):

  • Registry Pattern ✅ (pkg/tools/registry.go)
  • Composable Tools ✅ (multiple examples)
  • Fluent Builders ✅ (pkg/core/overpass.go)
  • Service Pattern ✅ (pkg/core/osrm.go, etc.)

Status: ✅ Accurate (with README.md omissions noted in Issue #2)


Documentation Quality by File

README.md: 🟡 Good with Issues

Score: 85/100

Strengths:

  • Comprehensive tool table with examples
  • Clear installation instructions
  • Good API usage documentation
  • Accurate rate limit information

Issues:

  • ❌ Tool count mismatch (claims 14, should be 25)
  • ❌ Lists 3 tools that aren't registered
  • ❌ Missing 3 packages in project structure
  • ⚠️ Could benefit from architecture diagram

Recommendations:

  1. Fix tool count in project structure section
  2. Verify all tools in table are actually registered
  3. Add missing packages: pkg/core, pkg/monitoring, pkg/tracing
  4. Consider adding visual architecture diagram

CLAUDE.md: 🟢 Excellent

Score: 95/100

Strengths:

  • Comprehensive technical reference
  • Accurate command-line flag documentation
  • Detailed monitoring and metrics information
  • Good code examples
  • Accurate architecture description

Issues:

  • ⚠️ Claims "30+ OSM-specific tools" (should be 25)
  • ⚠️ Missing --merge-only flag documentation

Recommendations:

  1. Update tool count to "25 tools"
  2. Add --merge-only flag to flag documentation

TRACING.md: 🟢 Excellent

Score: 98/100

Strengths:

  • Clear, well-structured
  • Excellent examples (Jaeger, Tempo)
  • Good troubleshooting section
  • Accurate technical details

Issues:

  • None identified

Status: ✅ Production-ready


MCP_TRANSPORT_STANDARDIZATION_ANALYSIS.md: 🔴 Outdated

Score: 30/100 (as current documentation)

Issues:

  • ❌ States dual transport is broken (it's been fixed)
  • ❌ Dated 2025-11-12 but code has since been updated
  • ❌ Compliance score of 80% likely no longer accurate

Recommendation: ARCHIVE THIS DOCUMENT or add clear resolution status banner:

# ⚠️ STATUS: RESOLVED
**Date Fixed:** 2025-11-14
**Current Status:** Dual transport support has been implemented in main.go (lines 242-286)

---

# [Original Analysis Below]
# OSM MCP Transport Standardization Analysis
...

pkg/osm/README.md: 🟢 Good

Score: 88/100

Strengths:

  • Clear package overview
  • Good function documentation
  • Accurate design principles

Issues:

  • ⚠️ References "14 tools" (should be 25)
  • ⚠️ Could expand on rate limiting details

docs/refactoring.md: 🟢 Good (Planning Doc)

Score: N/A (planning document)

Status: Good historical record of refactoring decisions. Useful for understanding the evolution of the codebase.


docs/tool_prompt_pattern.md: 🟢 Excellent

Score: 95/100

Status: Clear, concise, good examples. Useful for understanding the MCP prompt pattern.


Recommendations Summary

Immediate Actions (Critical)

  1. Fix Tool Count Consistency

    • Update CLAUDE.md: Change "30+ tools" to "25 tools"
    • Update README.md project structure: Change "14 tools" to "25 tools"
    • DECISION NEEDED: Register the 3 unregistered tools OR remove from README table
  2. Update Package Structure in README.md

    • Add pkg/core package description
    • Add pkg/monitoring package description
    • Add pkg/tracing package description
  3. Archive/Update Transport Analysis

    • Add "RESOLVED" banner to MCP_TRANSPORT_STANDARDIZATION_ANALYSIS.md
    • OR move to docs/archive/ directory
    • Update status to reflect fixed dual transport

Short-term Actions (Important)

  1. Complete Flag Documentation

    • Add --merge-only flag to CLAUDE.md
  2. Verify Unregistered Tools

    • Test find_route_charging_stations functionality
    • Test get_route functionality
    • Test search_category functionality
    • EITHER: Add to registry.go OR mark as deprecated/remove

Long-term Actions (Enhancement)

  1. Add Visual Documentation

    • Create architecture diagram for README.md
    • Add data flow diagrams for complex operations
  2. Enhance Tool Documentation

    • Add more usage examples for each tool
    • Create troubleshooting guide for common issues
  3. Version Documentation

    • Add changelog/release notes documentation
    • Document version history and breaking changes

Documentation Health Metrics

Metric Score Status
Overall Accuracy 85% 🟡 Good
Completeness 80% 🟡 Good
Up-to-date 75% 🟡 Fair
Code Examples 90% 🟢 Excellent
API Documentation 95% 🟢 Excellent
User Guides 85% 🟡 Good

Conclusion

The osmmcp project has strong, comprehensive documentation that serves both human developers and AI assistants well. The main issues are:

  1. Tool count inconsistencies across multiple files
  2. Unregistered tools that appear in documentation but not in code
  3. One outdated status document that needs archival

These are all easily fixable and don't reflect fundamental issues with the project's documentation philosophy or maintenance.

The TRACING.md and CLAUDE.md files are particularly well-done and serve as good examples of technical documentation.

Overall Grade: B+ (87/100)

With the recommended fixes applied, this would be A-grade documentation (95/100).


Files for Update Priority

Priority 1 (Must Fix)

  1. README.md - Tool count and package structure
  2. CLAUDE.md - Tool count claim
  3. MCP_TRANSPORT_STANDARDIZATION_ANALYSIS.md - Archive or update

Priority 2 (Should Fix)

  1. pkg/osm/README.md - Tool count reference
  2. pkg/tools/registry.go - Register missing tools OR deprecate them

Priority 3 (Nice to Have)

  1. Add architecture diagrams
  2. Expand troubleshooting documentation
  3. Add changelog documentation

Audit completed: 2025-11-16 Next review recommended: After fixing Priority 1 issues