Skip to content

Add GitHub MCP Server Integration to Java Spring AI#108

Open
parthloglogn wants to merge 2 commits intospring-projects:mainfrom
parthloglogn:main
Open

Add GitHub MCP Server Integration to Java Spring AI#108
parthloglogn wants to merge 2 commits intospring-projects:mainfrom
parthloglogn:main

Conversation

@parthloglogn
Copy link
Copy Markdown

This pull request introduces the initial implementation of a Java/Spring-based GitHub MCP server. The changes lay the foundation for a production-ready server that exposes the GitHub API via the MCP protocol, supporting repository, issue, pull request, and search operations through a natural language interface. The implementation includes core configuration, HTTP clients for REST and GraphQL, DTOs for API responses and requests, and basic health endpoints. It also provides comprehensive documentation and environment setup.

Key highlights of the changes:

Documentation and Project Setup

  • Added a detailed README.md describing features, architecture, configuration, client integration, Docker usage, troubleshooting, and package structure.
  • Introduced a .gitignore with rules for IDEs, build outputs, logs, and environment files.

Core Application and Configuration

  • Implemented the main Spring Boot application entry point in GithubMcpApplication.java and enabled configuration properties scanning.
  • Added GitHubProperties.java to centralize all configuration options (token, host, toolsets, etc.).
  • Created WebConfig.java to configure the Jackson ObjectMapper (snake_case, JavaTime support) and provide a RestTemplate bean.

GitHub API Clients

  • Added GitHubRestClient.java for REST API communication, including authentication, error handling, and serialization.
  • Added GitHubGraphqlClient.java for GraphQL API access, supporting queries with variables and proper header management.

API Structure and DTOs

  • Introduced ApiResponse.java and PagedResponse.java for consistent API responses, including error handling and pagination. [1] [2]
  • Added request DTOs such as CreateBranchRequest.java and CreateFileRequest.java for repository operations. [1] [2]

Health and Utility Endpoints

  • Implemented a HealthController.java with /health and /ping endpoints for service monitoring.

Signed-off-by: loglogn <parthloglogn@gmail.com>
Signed-off-by: loglogn <parthloglogn@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant