Skip to content

Commit a577480

Browse files
Merge branch 'main' into patch-1
2 parents 2c41a37 + 3f68ffb commit a577480

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ A growing set of community-developed and maintained servers demonstrates various
8282
- **[Docker](https://github.com/ckreiling/mcp-server-docker)** - Integrate with Docker to manage containers, images, volumes, and networks.
8383
- **[Kubernetes](https://github.com/Flux159/mcp-server-kubernetes)** - Connect to Kubernetes cluster and manage pods, deployments, and services.
8484
- **[OpenAPI](https://github.com/snaggle-ai/openapi-mcp-server)** - Interact with [OpenAPI](https://www.openapis.org/) APIs.
85-
- **[Pandoc](https://github.com/vivekVells/mcp-pandoc)** - MCP server for seamless document format conversion using Pandoc, supporting Markdown, HTML, and plain text, with other formats like PDF, csv and docx in development.
85+
- **[Pandoc](https://github.com/vivekVells/mcp-pandoc)** - MCP server for seamless document format conversion using Pandoc, supporting Markdown, HTML, and plain text, with other formats like PDF, csv and docx in development.
86+
- **[Pinecone](https://github.com/sirmews/mcp-pinecone)** - MCP server for searching and uploading records to Pinecone. Allows for simple RAG features, leveraging Pinecone's Inference API.
8687
- **[HuggingFace Spaces](https://github.com/evalstate/mcp-hfspace)** - Server for using HuggingFace Spaces, supporting Open Source Image, Audio, Text Models and more. Claude Desktop mode for easy integration.
8788
- **[ChatSum](https://github.com/mcpso/mcp-server-chatsum)** - Query and Summarize chat messages with LLM. by [mcpso](https://mcp.so)
8889
- **[Data Exploration](https://github.com/reading-plus-ai/mcp-server-data-exploration)** - MCP server for autonomous data exploration on .csv-based datasets, providing intelligent insights with minimal effort. NOTE: Will execute arbitrary Python code on your machine, please use with caution!
@@ -93,12 +94,16 @@ A growing set of community-developed and maintained servers demonstrates various
9394
- **[RAG Web Browser](https://github.com/apify/mcp-server-rag-web-browser)** An MCP server for Apify's RAG Web Browser Actor to perform web searches, scrape URLs, and return content in Markdown.
9495
- **[XMind](https://github.com/apeyroux/mcp-xmind)** - Read and search through your XMind directory containing XMind files.
9596
- **[oatpp-mcp](https://github.com/oatpp/oatpp-mcp)** - C++ MCP integration for Oat++. Use [Oat++](https://oatpp.io) to build MCP servers.
97+
- **[Contentful-mcp](https://github.com/ivo-toby/contentful-mcp)** - Read, update, delete, publish content in your [Contentful](https://contentful.com) space(s) from this MCP Server.
98+
- **[Home Assistant](https://github.com/tevonsb/homeassistant-mcp)** - Interact with [Home Assistant](https://www.home-assistant.io/) including viewing and controlling lights, switches, sensors, and all other Home Assistant entities.
9699
- **[cognee-mcp](https://github.com/topoteretes/cognee-mcp-server)** - GraphRAG memory server with customizable ingestion, data processing and search
97100
- **[Airtable](https://github.com/domdomegg/airtable-mcp-server)** - Read and write access to [Airtable](https://airtable.com/) databases, with schema inspection.
98101
- **[mcp-k8s-go](https://github.com/strowk/mcp-k8s-go)** - Golang-based Kubernetes server for MCP to browse pods and their logs, events, namespaces and more. Built to be extensible.
102+
- **[Notion](https://github.com/v-3/notion-server)** (by v-3) - Notion MCP integration. Search, Read, Update, and Create pages through Claude chat.
103+
- **[Notion](https://github.com/suekou/mcp-notion-server)** (by suekou) - Interact with Notion API.
99104
- **[TMDB](https://github.com/Laksh-star/mcp-server-tmdb)** - This MCP server integrates with The Movie Database (TMDB) API to provide movie information, search capabilities, and recommendations.
100105
- **[MongoDB](https://github.com/kiliczsh/mcp-mongo-server)** - A Model Context Protocol Server for MongoDB.
101-
106+
- **[Airtable](https://github.com/felores/airtable-mcp)** - Airtable Model Context Protocol Server.
102107

103108
## 📚 Resources
104109

src/git/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ Please note that mcp-server-git is currently in early development. The functiona
7373
- `repo_path` (string): Path to Git repository
7474
- `branch_name` (string): Name of branch to checkout
7575
- Returns: Confirmation of branch switch
76+
9. `git_show`
77+
- Shows the contents of a commit
78+
- Inputs:
79+
- `repo_path` (string): Path to Git repository
80+
- `revision` (string): The revision (commit hash, branch name, tag) to show
81+
- Returns: Contents of the specified commit
7682

7783
## Installation
7884

src/git/src/mcp_server_git/server.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ class GitCheckout(BaseModel):
5252
repo_path: str
5353
branch_name: str
5454

55+
class GitShow(BaseModel):
56+
repo_path: str
57+
revision: str
58+
5559
class GitTools(str, Enum):
5660
STATUS = "git_status"
5761
DIFF_UNSTAGED = "git_diff_unstaged"
@@ -63,6 +67,7 @@ class GitTools(str, Enum):
6367
LOG = "git_log"
6468
CREATE_BRANCH = "git_create_branch"
6569
CHECKOUT = "git_checkout"
70+
SHOW = "git_show"
6671

6772
def git_status(repo: git.Repo) -> str:
6873
return repo.git.status()
@@ -113,6 +118,24 @@ def git_checkout(repo: git.Repo, branch_name: str) -> str:
113118
repo.git.checkout(branch_name)
114119
return f"Switched to branch '{branch_name}'"
115120

121+
def git_show(repo: git.Repo, revision: str) -> str:
122+
commit = repo.commit(revision)
123+
output = [
124+
f"Commit: {commit.hexsha}\n"
125+
f"Author: {commit.author}\n"
126+
f"Date: {commit.authored_datetime}\n"
127+
f"Message: {commit.message}\n"
128+
]
129+
if commit.parents:
130+
parent = commit.parents[0]
131+
diff = parent.diff(commit, create_patch=True)
132+
else:
133+
diff = commit.diff(git.NULL_TREE, create_patch=True)
134+
for d in diff:
135+
output.append(f"\n--- {d.a_path}\n+++ {d.b_path}\n")
136+
output.append(d.diff.decode('utf-8'))
137+
return "".join(output)
138+
116139
async def serve(repository: Path | None) -> None:
117140
logger = logging.getLogger(__name__)
118141

@@ -179,6 +202,11 @@ async def list_tools() -> list[Tool]:
179202
description="Switches branches",
180203
inputSchema=GitCheckout.schema(),
181204
),
205+
Tool(
206+
name=GitTools.SHOW,
207+
description="Shows the contents of a commit",
208+
inputSchema=GitShow.schema(),
209+
)
182210
]
183211

184212
async def list_repos() -> Sequence[str]:
@@ -290,6 +318,13 @@ async def call_tool(name: str, arguments: dict) -> list[TextContent]:
290318
text=result
291319
)]
292320

321+
case GitTools.SHOW:
322+
result = git_show(repo, arguments["revision"])
323+
return [TextContent(
324+
type="text",
325+
text=result
326+
)]
327+
293328
case _:
294329
raise ValueError(f"Unknown tool: {name}")
295330

0 commit comments

Comments
 (0)