dify-mcp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dify_mcp-0.1.0/.env.example +10 -0
- dify_mcp-0.1.0/.github/workflows/publish.yml +63 -0
- dify_mcp-0.1.0/.gitignore +7 -0
- dify_mcp-0.1.0/Dify-API.md +1470 -0
- dify_mcp-0.1.0/LICENSE +21 -0
- dify_mcp-0.1.0/PKG-INFO +231 -0
- dify_mcp-0.1.0/README.md +206 -0
- dify_mcp-0.1.0/mcp.json.example +16 -0
- dify_mcp-0.1.0/pyproject.toml +42 -0
- dify_mcp-0.1.0/scripts/health_check.py +50 -0
- dify_mcp-0.1.0/server.json +53 -0
- dify_mcp-0.1.0/src/dify_mcp/__init__.py +3 -0
- dify_mcp-0.1.0/src/dify_mcp/config.py +64 -0
- dify_mcp-0.1.0/src/dify_mcp/dify_client.py +134 -0
- dify_mcp-0.1.0/src/dify_mcp/formatters.py +56 -0
- dify_mcp-0.1.0/src/dify_mcp/server.py +217 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Dify Knowledge API
|
|
2
|
+
DIFY_API_BASE=http://your-dify-host/v1
|
|
3
|
+
DIFY_API_KEY=dataset-your-api-key-here
|
|
4
|
+
|
|
5
|
+
# Comma-separated dataset UUIDs (required)
|
|
6
|
+
DIFY_ALLOWED_DATASETS=dataset-uuid-1,dataset-uuid-2
|
|
7
|
+
|
|
8
|
+
# Optional
|
|
9
|
+
DIFY_TIMEOUT=30
|
|
10
|
+
DIFY_VERIFY_SSL=false
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
# Push a version tag (e.g. `git tag v0.1.0 && git push origin v0.1.0`) to:
|
|
4
|
+
# 1. build the package
|
|
5
|
+
# 2. publish it to PyPI via Trusted Publishing (OIDC, no token stored)
|
|
6
|
+
# 3. register the server on the official MCP Registry via GitHub OIDC
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
tags: ["v*"]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
publish:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
environment: pypi
|
|
15
|
+
permissions:
|
|
16
|
+
id-token: write # required for PyPI Trusted Publishing AND MCP Registry OIDC
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout code
|
|
21
|
+
uses: actions/checkout@v5
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.12"
|
|
27
|
+
|
|
28
|
+
- name: Verify tag matches pyproject version
|
|
29
|
+
run: |
|
|
30
|
+
TAG="${GITHUB_REF#refs/tags/v}"
|
|
31
|
+
PKG="$(grep -m1 '^version' pyproject.toml | sed -E 's/.*"(.*)".*/\1/')"
|
|
32
|
+
echo "tag=$TAG pyproject=$PKG"
|
|
33
|
+
if [ "$TAG" != "$PKG" ]; then
|
|
34
|
+
echo "::error::Tag v$TAG does not match pyproject version $PKG"
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
- name: Build package
|
|
39
|
+
run: |
|
|
40
|
+
python -m pip install --upgrade build
|
|
41
|
+
python -m build
|
|
42
|
+
|
|
43
|
+
- name: Publish to PyPI (Trusted Publishing)
|
|
44
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
45
|
+
|
|
46
|
+
- name: Install mcp-publisher
|
|
47
|
+
run: |
|
|
48
|
+
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
|
|
49
|
+
|
|
50
|
+
- name: Sync server.json version to tag
|
|
51
|
+
run: |
|
|
52
|
+
VERSION="${GITHUB_REF#refs/tags/v}"
|
|
53
|
+
jq --arg v "$VERSION" '.version = $v | .packages[0].version = $v' server.json > server.tmp
|
|
54
|
+
mv server.tmp server.json
|
|
55
|
+
|
|
56
|
+
- name: Wait for PyPI to index the new release
|
|
57
|
+
run: sleep 30
|
|
58
|
+
|
|
59
|
+
- name: Authenticate to MCP Registry (GitHub OIDC)
|
|
60
|
+
run: ./mcp-publisher login github-oidc
|
|
61
|
+
|
|
62
|
+
- name: Publish server to MCP Registry
|
|
63
|
+
run: ./mcp-publisher publish
|