Skip to content

Commit fc98eb1

Browse files
authored
Merge pull request #59 from neo4j-contrib/add-data-modeling-mcp-server
Add data modeling mcp server
2 parents f437920 + d896acc commit fc98eb1

File tree

20 files changed

+3216
-0
lines changed

20 files changed

+3216
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: MCP Neo4j Data Modeling Tests
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths:
7+
- 'servers/mcp-neo4j-data-modeling/**'
8+
pull_request:
9+
branches: [ main, master ]
10+
paths:
11+
- 'servers/mcp-neo4j-data-modeling/**'
12+
workflow_dispatch: # Allows manual triggering of the workflow
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Set up Python 3.12
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: '3.12'
25+
26+
- name: Install UV
27+
run: |
28+
curl -LsSf https://astral.sh/uv/install.sh | sh
29+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
30+
31+
- name: Install dependencies
32+
run: |
33+
cd servers/mcp-neo4j-data-modeling
34+
uv venv
35+
uv pip install -e ".[dev]"
36+
37+
- name: Check format and linting
38+
run: |
39+
cd servers/mcp-neo4j-data-modeling
40+
make format
41+
42+
- name: Run tests
43+
run: |
44+
cd servers/mcp-neo4j-data-modeling
45+
make test
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# This workflow will upload a Python Package to PyPI when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Publish Neo4j MCP Data Modeling Package
10+
11+
on:
12+
push:
13+
tags:
14+
- mcp-neo4j-data-modeling-v*
15+
workflow_dispatch: # Allows manual triggering of the workflow
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
release-build:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.x"
30+
31+
- name: Build release distributions
32+
run: |
33+
cd servers/mcp-neo4j-data-modeling/
34+
python -m pip install build
35+
python -m build
36+
37+
- name: Upload distributions
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: release-dists
41+
path: servers/mcp-neo4j-data-modeling/dist/
42+
43+
pypi-publish:
44+
runs-on: ubuntu-latest
45+
needs:
46+
- release-build
47+
permissions:
48+
# IMPORTANT: this permission is mandatory for trusted publishing
49+
id-token: write
50+
51+
# Dedicated environments with protections for publishing are strongly recommended.
52+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
53+
environment:
54+
name: pypi
55+
url: https://pypi.org/project/mcp-neo4j-data-modeling/
56+
57+
steps:
58+
59+
- uses: actions/checkout@v4
60+
61+
- name: Install uv
62+
uses: astral-sh/setup-uv@v5
63+
64+
- name: "Set up Python"
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version-file: "servers/mcp-neo4j-data-modeling/pyproject.toml"
68+
69+
- name: Build release distributions
70+
run: |
71+
cd servers/mcp-neo4j-data-modeling/
72+
uv build
73+
74+
- name: Publish release
75+
env:
76+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
77+
run: |
78+
cd servers/mcp-neo4j-data-modeling/
79+
uv publish

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ Thumbs.db
4545
.nx/cache
4646
.nx/workspace-data
4747
__pycache__
48+
servers/mcp-neo4j-data-modeling/test.ipynb
49+
servers/mcp-neo4j-data-modeling/src/mcp_neo4j_data_modeling/temp.html
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# Virtual Environment
24+
venv/
25+
env/
26+
ENV/
27+
28+
# IDE
29+
.idea/
30+
.vscode/
31+
*.swp
32+
*.swo
33+
34+
# Git
35+
.git
36+
.gitignore
37+
38+
# Docker
39+
Dockerfile
40+
.dockerignore
41+
42+
# Documentation
43+
docs/
44+
*.md
45+
!README.md
46+
!pyproject.toml
47+
48+
# Tests
49+
tests/
50+
test/
51+
testing/
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[flake8]
2+
exclude =
3+
.git,
4+
__pycache__,
5+
build,
6+
dist,
7+
.tox,
8+
venv,
9+
.venv,
10+
.pytest_cache
11+
max-line-length = 120
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12.7
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Next
2+
3+
### Fixed
4+
5+
### Changed
6+
7+
### Added
8+
9+
10+
## v0.1.0
11+
12+
* Basic functionality
13+
* Expose schemas for Data Model, Node, Relationship and Property
14+
* Validation tools
15+
* Visualize data model in interactive browser window
16+
* Import / Export from Arrows web application
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM python:3.12-slim
2+
3+
# Set working directory
4+
WORKDIR /app
5+
6+
# Install build dependencies
7+
RUN pip install uv
8+
9+
# Copy dependency files first
10+
COPY pyproject.toml /app/
11+
COPY uv.lock /app/
12+
13+
# Copy the source code
14+
COPY src/ /app/src/
15+
COPY README.md /app/
16+
17+
# Install the package
18+
RUN uv sync
19+
20+
21+
# Command to run the server using the package entry point
22+
CMD ["sh", "-c", "uv run mcp-neo4j-data-modeling --transport ${MCP_TRANSPORT}"]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Makefile for cypher-guard Python bindings
2+
3+
.PHONY: format test clean inspector build_local_docker_image
4+
5+
format:
6+
uv run ruff check --select I . --fix
7+
uv run ruff check --fix .
8+
uv run ruff format .
9+
10+
test:
11+
uv run pytest tests/ -s
12+
13+
inspector:
14+
npx @modelcontextprotocol/inspector uv --directory src/mcp_neo4j_data_modeling run mcp-neo4j-data-modeling
15+
16+
build_local_docker_image:
17+
docker build -t mcp-neo4j-data-modeling .
18+
19+
clean:
20+
rm -rf .mypy_cache/
21+
rm -rf .ruff_cache/
22+
rm -rf .pytest_cache/
23+
rm -rf .vscode/
24+
rm -rf .venv/
25+
rm -rf .mypy_cache/
26+
rm -rf .ruff_cache/
27+
rm -rf .pytest_cache/

0 commit comments

Comments
 (0)