iflow-mcp_harimkang-mcp-korea-tourism-api 0.1.2__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.
Files changed (39) hide show
  1. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/.dockerignore +64 -0
  2. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/.github/workflows/ci.yml +79 -0
  3. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/.github/workflows/publish.yml +56 -0
  4. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/.gitignore +11 -0
  5. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/.pre-commit-config.yaml +37 -0
  6. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/.python-version +1 -0
  7. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/3107_process.log +2 -0
  8. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/Dockerfile +67 -0
  9. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/LICENSE +21 -0
  10. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/PKG-INFO +382 -0
  11. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/README.ko.md +355 -0
  12. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/README.md +358 -0
  13. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/docker-compose.yml +98 -0
  14. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/images/cursor_integration.png +0 -0
  15. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/images/find_accommodations.png +0 -0
  16. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/images/find_nearby_attractions.png +0 -0
  17. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/images/get_area_codes.png +0 -0
  18. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/images/get_detailed_information.png +0 -0
  19. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/images/get_tourism_by_area.png +0 -0
  20. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/images/get_tourism_images.png +0 -0
  21. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/images/search_festivals_by_date.png +0 -0
  22. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/images/search_tourism_by_keyword.png +0 -0
  23. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/language.json +1 -0
  24. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/package_name +1 -0
  25. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/push_info.json +5 -0
  26. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/pyproject.toml +48 -0
  27. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/requirements.txt +335 -0
  28. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/smithery.yaml +23 -0
  29. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/src/mcp_tourism/__init__.py +0 -0
  30. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/src/mcp_tourism/api_client.py +1339 -0
  31. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/src/mcp_tourism/server.py +1156 -0
  32. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/test_server.py +71 -0
  33. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/tests/__init__.py +0 -0
  34. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/tests/conftest.py +12 -0
  35. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/tests/test_api_client.py +695 -0
  36. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/tests/test_integration.py +242 -0
  37. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/tests/test_server.py +84 -0
  38. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/tests/test_transport.py +479 -0
  39. iflow_mcp_harimkang_mcp_korea_tourism_api-0.1.2/uv.lock +773 -0
@@ -0,0 +1,64 @@
1
+ # .dockerignore
2
+ # Python bytecode and cache
3
+ __pycache__/
4
+ *.py[cod]
5
+ *$py.class
6
+
7
+ # Distribution / packaging
8
+ .Python
9
+ build/
10
+ develop-eggs/
11
+ dist/
12
+ downloads/
13
+ eggs/
14
+ .eggs/
15
+ lib/
16
+ lib64/
17
+ parts/
18
+ sdist/
19
+ var/
20
+ wheels/
21
+ share/python-wheels/
22
+ *.egg-info/
23
+ .installed.cfg
24
+ *.egg
25
+ MANIFEST
26
+
27
+ # PyInstaller
28
+ # Usually these files are written by a python script from a template
29
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.log
48
+ .hypothesis/
49
+ .pytest_cache/
50
+
51
+ # Virtual Environments
52
+ .venv/
53
+ env/
54
+ venv/
55
+ ENV/
56
+ env.bak/
57
+ venv.bak/
58
+
59
+ # OS specific files
60
+ .DS_Store
61
+
62
+ # IDE files
63
+ .idea/
64
+ .vscode/
@@ -0,0 +1,79 @@
1
+ name: CI Pipeline
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ types: [opened, synchronize, reopened, ready_for_review] # Trigger on relevant PR events
8
+ branches: [main]
9
+
10
+ jobs:
11
+ test:
12
+ # Don't run on draft PRs
13
+ if: github.event.pull_request.draft == false
14
+
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - name: Checkout code
19
+ uses: actions/checkout@v4
20
+
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12" # Match project's Python version
25
+
26
+ - name: Install uv
27
+ run: curl -LsSf https://astral.sh/uv/install.sh | sh && echo "$HOME/.cargo/bin" >> $GITHUB_PATH
28
+ shell: bash
29
+
30
+ - name: Verify uv installation
31
+ run: uv --version
32
+
33
+ - name: Install Python dependencies including dev group
34
+ # Installs main dependencies and those listed under [project.optional-dependencies.dev]
35
+ run: uv sync --dev --all-extras
36
+
37
+ # --- Add this step to install the project itself ---
38
+ - name: Install project in editable mode
39
+ # This makes the 'mcp_tourism' package importable from the src directory
40
+ run: uv pip install -e .
41
+
42
+ # --- 0. Pre-commit ---
43
+ - name: Run pre-commit
44
+ run: uv run pre-commit run --all-files
45
+
46
+ # --- 1. Unit Tests ---
47
+ - name: Run Unit Tests with pytest via uv
48
+ # Run pytest using uv run to ensure correct environment context
49
+ # This step will fail if any unit test fails, stopping the workflow here
50
+ run: uv run pytest tests/
51
+
52
+ # --- 2. uv Run Test ---
53
+ # This step only runs if unit tests passed
54
+ - name: Run server with uv briefly
55
+ run: |
56
+ echo "Attempting to run server with uv for 5 seconds..."
57
+ # Run uv in the background, wait 5 seconds, then kill it.
58
+ # Check if the process exits with expected codes (0, 124 for timeout, 143 for SIGTERM).
59
+ timeout 5s uv run -m mcp_tourism.server || status=$?
60
+ if [[ $status != 124 && $status != 143 && $status != 0 ]]; then
61
+ echo "uv run command failed with unexpected status: $status"
62
+ exit $status
63
+ elif [[ $status == 124 || $status == 143 ]]; then
64
+ echo "uv run process successfully killed by timeout/SIGTERM as expected."
65
+ # Treat timeout/sigterm as success for this check
66
+ elif [[ $status == 0 ]]; then
67
+ echo "uv run process exited cleanly (unexpected but okay)."
68
+ fi
69
+ echo "uv run check passed."
70
+ env:
71
+ # Use a dummy key for CI environment where actual API calls aren't made
72
+ KOREA_TOURISM_API_KEY: "DUMMY_FOR_CI"
73
+ shell: bash
74
+
75
+ # --- 3. Docker Test ---
76
+ # This step only runs if uv run test passed
77
+ - name: Build Docker image
78
+ # This step will fail if the build fails
79
+ run: docker build -t mcp-korea-tourism .
@@ -0,0 +1,56 @@
1
+ name: Publish Python Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*" # Trigger on version tags like v0.1.0
7
+
8
+ jobs:
9
+ deploy:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ # Needed for PyPI trusted publishing or token upload
13
+ id-token: write
14
+ # Needed to create Releases
15
+ contents: write
16
+ # Needed to publish to GitHub Packages
17
+ packages: write
18
+
19
+ steps:
20
+ - name: Checkout code
21
+ uses: actions/checkout@v4
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.12" # Match project's Python version
27
+
28
+ - name: Install build dependencies
29
+ run: |
30
+ python -m pip install --upgrade pip
31
+ pip install build twine
32
+
33
+ - name: Build package
34
+ run: python -m build
35
+
36
+ - name: Publish package to PyPI using twine directly
37
+ # Run twine upload directly using the installed twine version
38
+ # This uses the token stored in GitHub Secrets via environment variables
39
+ run: >-
40
+ twine upload dist/*
41
+ env:
42
+ TWINE_USERNAME: __token__
43
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
44
+
45
+ - name: Create GitHub Release
46
+ # Run only if PyPI/twine upload succeeded
47
+ uses: softprops/action-gh-release@v2.0.9
48
+ if: success() # Check if the twine upload step succeeded
49
+ with:
50
+ # Creates release based on the tag name (e.g., v0.1.0)
51
+ # You can customize the release name and body if needed
52
+ # name: Release ${{ github.ref_name }}
53
+ # body: See CHANGELOG.md for details.
54
+ files: dist/* # Uploads the .whl and .tar.gz files as assets
55
+ env:
56
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Uses the default GitHub token
@@ -0,0 +1,11 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+ node_modules/
@@ -0,0 +1,37 @@
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v5.0.0
6
+ hooks:
7
+ - id: trailing-whitespace
8
+ - id: end-of-file-fixer
9
+ - id: check-yaml
10
+ - id: check-added-large-files
11
+
12
+ - repo: https://github.com/astral-sh/uv-pre-commit
13
+ # uv version.
14
+ rev: 0.7.7
15
+ hooks:
16
+ - id: uv-lock
17
+
18
+ - repo: https://github.com/astral-sh/uv-pre-commit
19
+ # uv version.
20
+ rev: 0.7.7
21
+ hooks:
22
+ - id: uv-export
23
+
24
+ - repo: https://github.com/astral-sh/ruff-pre-commit
25
+ # Ruff version.
26
+ rev: v0.11.11
27
+ hooks:
28
+ # Run the linter.
29
+ - id: ruff-check
30
+ args: [--fix]
31
+ # Run the formatter.
32
+ - id: ruff-format
33
+
34
+ - repo: https://github.com/pre-commit/mirrors-prettier
35
+ rev: v4.0.0-alpha.8
36
+ hooks:
37
+ - id: prettier
@@ -0,0 +1,2 @@
1
+ [2026-02-05 00:00:00] [INFO] 步骤2: 代码阅读完成 - 项目类型: MCP服务端项目; 语言类型: Python; 协议支持: stdio, streamable-http, sse; 是否SKILL项目: 否; 是否代理服务: 否; 项目状态: 正常
2
+ [2026-02-05 00:00:00] [INFO] 步骤3: 本地测试完成 - 测试成功, 工具数量: 8, 环境变量: KOREA_TOURISM_API_KEY=test_key
@@ -0,0 +1,67 @@
1
+ # Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
2
+ # syntax=docker/dockerfile:1
3
+
4
+ # Use the Python version confirmed from .python-version
5
+ FROM python:3.12-slim
6
+
7
+ # Install uv and curl for health checks
8
+ # --no-cache-dir reduces image size
9
+ RUN apt-get update && apt-get install -y --no-install-recommends curl && \
10
+ rm -rf /var/lib/apt/lists/* && \
11
+ pip install --no-cache-dir uv
12
+
13
+ # Set the working directory in the container
14
+ WORKDIR /app
15
+
16
+ # Copy dependency files first to leverage Docker cache
17
+ COPY pyproject.toml ./
18
+
19
+ # Generate requirements.txt from pyproject.toml dependencies section directly
20
+ # This avoids trying to find the local project and only focuses on external dependencies
21
+ RUN python -c "import tomllib; deps = tomllib.load(open('pyproject.toml', 'rb'))['project']['dependencies']; print('\n'.join(deps))" > requirements.txt
22
+
23
+ # Install dependencies using pip from the requirements.txt
24
+ RUN pip install --no-cache-dir -r requirements.txt
25
+
26
+ # Copy the rest of the application source code (including the src directory)
27
+ COPY . .
28
+
29
+ # Install the project itself from the src directory
30
+ # This makes the mcp_tourism package available to the Python interpreter
31
+ # --no-deps prevents reinstalling already synced dependencies
32
+ # --system is required because we are not in a virtual environment
33
+ RUN uv pip install . --no-deps --system
34
+
35
+ # Build arguments for configuration (can be set during docker build)
36
+ ARG MCP_TRANSPORT=stdio
37
+ ARG MCP_HOST=0.0.0.0
38
+ ARG MCP_PORT=8000
39
+ ARG MCP_PATH=/mcp
40
+ ARG MCP_LOG_LEVEL=INFO
41
+
42
+ # Set environment variables from build args (these can be overridden at runtime)
43
+ ENV MCP_TRANSPORT=${MCP_TRANSPORT}
44
+ ENV MCP_HOST=${MCP_HOST}
45
+ ENV MCP_PORT=${MCP_PORT}
46
+ ENV MCP_PATH=${MCP_PATH}
47
+ ENV MCP_LOG_LEVEL=${MCP_LOG_LEVEL}
48
+
49
+ # Set the API key as an environment variable
50
+ # IMPORTANT: It's strongly recommended to pass the API key securely at runtime using -e.
51
+ # Example runtime command: docker run -e KOREA_TOURISM_API_KEY="YOUR_ACTUAL_API_KEY" ...
52
+ # ENV KOREA_TOURISM_API_KEY="YOUR_ACTUAL_API_KEY" # Avoid hardcoding if possible
53
+
54
+ # Expose common ports (8000 is default, but can be changed at runtime)
55
+ EXPOSE 8000 8080 3000
56
+
57
+ # Create a health check for HTTP transports
58
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
59
+ CMD if [ "$MCP_TRANSPORT" = "stdio" ]; then \
60
+ echo "stdio transport - health check passed"; \
61
+ else \
62
+ curl -f http://localhost:${MCP_PORT}/health || exit 1; \
63
+ fi
64
+
65
+ # Command to run the application
66
+ # Use python -m directly instead of uv run to avoid creating a virtual env at runtime
67
+ CMD ["python", "-m", "mcp_tourism.server"]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Harim Kang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.