Skip to content

Commit

Permalink
Merge branch 'main' into mahesh/readme-edits
Browse files Browse the repository at this point in the history
  • Loading branch information
maheshmurag authored Nov 22, 2024
2 parents c70e8ba + ba35422 commit a25d94d
Show file tree
Hide file tree
Showing 27 changed files with 881 additions and 967 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Python

on:
push:
branches:
- main
pull_request:
release:
types: [published]

jobs:
detect-packages:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.find-packages.outputs.packages }}
steps:
- uses: actions/checkout@v4

- name: Find Python packages
id: find-packages
working-directory: src
run: |
PACKAGES=$(find . -name pyproject.toml -exec dirname {} \; | sed 's/^\.\///' | jq -R -s -c 'split("\n")[:-1]')
echo "packages=$PACKAGES" >> $GITHUB_OUTPUT
build:
needs: [detect-packages]
strategy:
matrix:
package: ${{ fromJson(needs.detect-packages.outputs.packages) }}
name: Build ${{ matrix.package }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "src/${{ matrix.package }}/.python-version"

- name: Install dependencies
working-directory: src/${{ matrix.package }}
run: uv sync --frozen --all-extras --dev

- name: Run pyright
working-directory: src/${{ matrix.package }}
run: uv run --frozen pyright

- name: Build package
working-directory: src/${{ matrix.package }}
run: uv build

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.package }}
path: src/${{ matrix.package }}/dist/

publish:
runs-on: ubuntu-latest
needs: [build, detect-packages]
if: github.event_name == 'release'

strategy:
matrix:
package: ${{ fromJson(needs.detect-packages.outputs.packages) }}
name: Publish ${{ matrix.package }}

environment: release
permissions:
id-token: write # Required for trusted publishing

steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist-${{ matrix.package }}
path: dist/

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: TypeScript

on:
push:
branches:
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# MCP servers ![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%2Fexample-servers)

[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
# MCP servers

A collection of reference implementations and community-contributed servers for the [Model Context Protocol](https://modelcontextprotocol.io/) (MCP). This repository showcases the versatility and extensibility of MCP, demonstrating how it can be used to give Large Language Models (LLMs) secure, controlled access to tools and data sources.

Expand Down
2 changes: 1 addition & 1 deletion src/brave-search/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@modelcontextprotocol/server-brave-search",
"version": "0.2.0",
"version": "0.3.0",
"description": "MCP server for Brave Search API integration",
"license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)",
Expand Down
2 changes: 1 addition & 1 deletion src/everything/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@modelcontextprotocol/server-everything",
"version": "0.2.0",
"version": "0.3.0",
"description": "MCP server that exercises all the features of the MCP protocol",
"license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)",
Expand Down
2 changes: 1 addition & 1 deletion src/filesystem/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@modelcontextprotocol/server-filesystem",
"version": "0.2.0",
"version": "0.3.0",
"description": "MCP server for filesystem access",
"license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)",
Expand Down
2 changes: 1 addition & 1 deletion src/gdrive/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@modelcontextprotocol/server-gdrive",
"version": "0.2.0",
"version": "0.3.0",
"description": "MCP server for interacting with Google Drive",
"license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)",
Expand Down
87 changes: 58 additions & 29 deletions src/git/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
# mcp-git: A git MCP server
# mcp-server-git: A git MCP server

## Overview

A Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.

Please note that mcp-git is currently in early development. The functionality and available tools are subject to change and expansion as we continue to develop and improve the server.
Please note that mcp-server-git is currently in early development. The functionality and available tools are subject to change and expansion as we continue to develop and improve the server.

## Available Tools

The current list of tools includes:

- `git_read_file`: Read contents of a file at a specific Git reference
- `git_list_files`: List all files in a repository or subdirectory
- `git_file_history`: Get commit history for a specific file
- `git_commit`: Create Git commits with messages and specified files
- `git_search_code`: Search repository content with pattern matching
- `git_get_diff`: View diffs between Git references
- `git_get_repo_structure`: View repository file structure
- `git_list_repos`: List available Git repositories
- `git_log`: Retrieve commit log for the repository
- `git_list_branches`: List all branches in the repository
- `git_list_tags`: List all tags in the repository
- `git_status`: Shows the working tree status
- `git_diff_unstaged`: Shows changes in the working directory that are not yet staged
- `git_diff_staged`: Shows changes that are staged for commit
- `git_commit`: Records changes to the repository
- `git_add`: Adds file contents to the staging area
- `git_reset`: Unstages all staged changes
- `git_log`: Shows the commit logs

This list is expected to grow as we add more functionality to the server. We welcome contributions from the community to expand and enhance the available tools.

Expand All @@ -27,77 +25,108 @@ This list is expected to grow as we add more functionality to the server. We wel
### Using uv (recommended)

When using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will
use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-git*.
use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-server-git*.

### Using PIP

Alternatively you can install `mcp-git` via pip:
Alternatively you can install `mcp-server-git` via pip:

```
pip install mcp-git
pip install mcp-server-git
```

After installation, you can run it as a script using:

```
python -m mcp_git
python -m mcp_server_git
```

## Configuration

### Configure for Claude.app

Add to your Claude settings:

<details>
<summary>Using uvx</summary>

```json
"mcpServers": {
"mcp-git": {
"git": {
"command": "uvx",
"args": ["mcp-git", "--repository", "path/to/git/repo"]
"args": ["mcp-server-git", "--repository", "path/to/git/repo"]
}
}
```
</details>

Alternatively, if using pip installation:
<details>
<summary>Using pip installation</summary>

```json
"mcpServers": {
"mcp-git": {
"git": {
"command": "python",
"args": ["-m", "mcp_git", "--repository", "path/to/git/repo"]
"args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]
}
}
```
</details>

### Configure for Zed

Add to your Zed settings.json:

<details>
<summary>Using uvx</summary>

```json
"context_servers": [
"mcp-git": {
"mcp-server-git": {
"command": "uvx",
"args": ["mcp-git"]
"args": ["mcp-server-git"]
}
],
```
</details>

Alternatively, if using pip installation:
<details>
<summary>Using pip installation</summary>

```json
"context_servers": {
"mcp-git": {
"mcp-server-git": {
"command": "python",
"args": ["-m", "mcp-git"]
"args": ["-m", "mcp_server_git"]
}
},
```
</details>

## Debugging

You can use the MCP inspector to debug the server. For uvx installations:

```
npx @modelcontextprotocol/inspector uvx mcp-server-git
```

Or if you've installed the package in a specific directory or are developing on it:

```
cd path/to/servers/src/git
npx @modelcontextprotocol/inspector uv run mcp-server-git
```

## Contributing

We encourage contributions to help expand and improve mcp-git. Whether you want to add new tools, enhance existing functionality, or improve documentation, your input is valuable.
We encourage contributions to help expand and improve mcp-server-git. Whether you want to add new tools, enhance existing functionality, or improve documentation, your input is valuable.

For examples of other MCP servers and implementation patterns, see:
https://github.com/modelcontextprotocol/servers

Pull requests are welcome! Feel free to contribute new ideas, bug fixes, or enhancements to make mcp-git even more powerful and useful.
Pull requests are welcome! Feel free to contribute new ideas, bug fixes, or enhancements to make mcp-server-git even more powerful and useful.

## License

mcp-server-git is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
8 changes: 4 additions & 4 deletions src/git/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mcp-git"
version = "0.2.0"
name="mcp-server-git"
version = "0.4.0"
description = "A Model Context Protocol server providing tools to read, search, and manipulate Git repositories programmatically via LLMs"
readme = "README.md"
requires-python = ">=3.10"
Expand All @@ -23,11 +23,11 @@ dependencies = [
]

[project.scripts]
mcp-git = "mcp_git:main"
mcp-server-git = "mcp_server_git:main"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.uv]
dev-dependencies = ["ruff>=0.7.3"]
dev-dependencies = ["pyright>=1.1.389", "ruff>=0.7.3"]
Loading

0 comments on commit a25d94d

Please sign in to comment.