mcp-server-llmling 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.
Files changed (46) hide show
  1. mcp_server_llmling-0.1.0/.copier-answers.yml +21 -0
  2. mcp_server_llmling-0.1.0/.github/FUNDING.yml +3 -0
  3. mcp_server_llmling-0.1.0/.github/copilot-instructions.md +19 -0
  4. mcp_server_llmling-0.1.0/.github/dependabot.yml +9 -0
  5. mcp_server_llmling-0.1.0/.github/workflows/build.yml +88 -0
  6. mcp_server_llmling-0.1.0/.github/workflows/documentation.yml +57 -0
  7. mcp_server_llmling-0.1.0/.gitignore +32 -0
  8. mcp_server_llmling-0.1.0/.logfire/.gitignore +1 -0
  9. mcp_server_llmling-0.1.0/.logfire/logfire_credentials.json +6 -0
  10. mcp_server_llmling-0.1.0/.pre-commit-config.yaml +48 -0
  11. mcp_server_llmling-0.1.0/LICENSE +22 -0
  12. mcp_server_llmling-0.1.0/PKG-INFO +314 -0
  13. mcp_server_llmling-0.1.0/README.md +263 -0
  14. mcp_server_llmling-0.1.0/docs/.empty +0 -0
  15. mcp_server_llmling-0.1.0/duties.py +60 -0
  16. mcp_server_llmling-0.1.0/mkdocs.yml +92 -0
  17. mcp_server_llmling-0.1.0/overrides/_dummy.txt +1 -0
  18. mcp_server_llmling-0.1.0/pyproject.toml +262 -0
  19. mcp_server_llmling-0.1.0/scripts/test_injection.py +86 -0
  20. mcp_server_llmling-0.1.0/scripts/test_server.py +29 -0
  21. mcp_server_llmling-0.1.0/src/mcp_server_llmling/__init__.py +12 -0
  22. mcp_server_llmling-0.1.0/src/mcp_server_llmling/__main__.py +201 -0
  23. mcp_server_llmling-0.1.0/src/mcp_server_llmling/config_resources/mcp_zed.yml +33 -0
  24. mcp_server_llmling-0.1.0/src/mcp_server_llmling/conversions.py +197 -0
  25. mcp_server_llmling-0.1.0/src/mcp_server_llmling/factory.py +64 -0
  26. mcp_server_llmling-0.1.0/src/mcp_server_llmling/handlers.py +199 -0
  27. mcp_server_llmling-0.1.0/src/mcp_server_llmling/injection.py +695 -0
  28. mcp_server_llmling-0.1.0/src/mcp_server_llmling/log.py +121 -0
  29. mcp_server_llmling-0.1.0/src/mcp_server_llmling/mcp_inproc_session.py +207 -0
  30. mcp_server_llmling-0.1.0/src/mcp_server_llmling/observers.py +258 -0
  31. mcp_server_llmling-0.1.0/src/mcp_server_llmling/py.typed +0 -0
  32. mcp_server_llmling-0.1.0/src/mcp_server_llmling/server.py +280 -0
  33. mcp_server_llmling-0.1.0/src/mcp_server_llmling/transports/__init__.py +0 -0
  34. mcp_server_llmling-0.1.0/src/mcp_server_llmling/transports/base.py +36 -0
  35. mcp_server_llmling-0.1.0/src/mcp_server_llmling/transports/sse.py +196 -0
  36. mcp_server_llmling-0.1.0/src/mcp_server_llmling/transports/stdio.py +43 -0
  37. mcp_server_llmling-0.1.0/src/mcp_server_llmling/zed_mode.py +173 -0
  38. mcp_server_llmling-0.1.0/src/mcp_server_llmling/zed_wrapper.py +123 -0
  39. mcp_server_llmling-0.1.0/tests/__init__.py +0 -0
  40. mcp_server_llmling-0.1.0/tests/conftest.py +176 -0
  41. mcp_server_llmling-0.1.0/tests/test_handshake.py +216 -0
  42. mcp_server_llmling-0.1.0/tests/test_injection_server.py.bak +238 -0
  43. mcp_server_llmling-0.1.0/tests/test_mcp_protocol.py +130 -0
  44. mcp_server_llmling-0.1.0/tests/test_observers.py +104 -0
  45. mcp_server_llmling-0.1.0/tests/test_server_integration.py +55 -0
  46. mcp_server_llmling-0.1.0/tests/test_uri_handling.py +61 -0
@@ -0,0 +1,21 @@
1
+ # Changes here will be overwritten by Copier
2
+ _commit: v1.8.1
3
+ _src_path: .\copier-phil65\
4
+ author_email: philipptemminghoff@googlemail.com
5
+ author_fullname: Philipp Temminghoff
6
+ author_username: phil65
7
+ copyright_date: '2024'
8
+ copyright_holder: Philipp Temminghoff
9
+ copyright_holder_email: philipptemminghoff@googlemail.com
10
+ libraries_use_pydantic: true
11
+ libraries_use_qt: false
12
+ project_description: MCP (Model context protocol) server with LLMling backend
13
+ project_name: mcp-server-llmling
14
+ python_minimum_version: '3.12'
15
+ python_package_command_line_name: mcp-server-llmling
16
+ python_package_distribution_name: mcp-server-llmling
17
+ python_package_import_name: mcp_server_llmling
18
+ repository_name: mcp-server-llmling
19
+ repository_namespace: phil65
20
+ repository_provider: github.com
21
+
@@ -0,0 +1,3 @@
1
+ github: phil65
2
+ custom:
3
+ - https://www.paypal.me/phil65
@@ -0,0 +1,19 @@
1
+ ## Code style
2
+
3
+ You can assume Python 3.12.
4
+ Use newest language features if possible
5
+ Consider using pattern matching, walrus operators and other new syntax features.
6
+ Adhere to pep8.
7
+
8
+ ## Tests
9
+
10
+ Tests are written using PyTest. Dont put tests into a class.
11
+
12
+ ## DocStrings
13
+
14
+ DocStrings are written in google-style.
15
+ Dont add the types to the "Args" section.
16
+ Only add a Return section if a value is returned and the meaning of the returned value
17
+ is not obvious.
18
+ You can use markdown admonitions with python-markdown syntax if neccessary (!!! info, !!! note, !!! warning).
19
+ You can use markdown tables and markdown lists if neccessary.
@@ -0,0 +1,9 @@
1
+ # Set update schedule for GitHub Actions
2
+
3
+ version: 2
4
+ updates:
5
+ - package-ecosystem: "github-actions"
6
+ directory: "/"
7
+ schedule:
8
+ # Check for updates to GitHub Actions every week
9
+ interval: "weekly"
@@ -0,0 +1,88 @@
1
+ name: Build
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ${{ matrix.os }}
8
+ continue-on-error: ${{ matrix.python_version == '3.14' }}
9
+ strategy:
10
+ matrix:
11
+ python_version: ["3.12", "3.13", "3.14"]
12
+ os: ["ubuntu-latest", "macos-latest", "windows-latest"]
13
+ steps:
14
+ - name: Check out repository
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Set up Python ${{ matrix.python_version }}
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: ${{ matrix.python_version }}
21
+ allow-prereleases: true
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v4
25
+ with:
26
+ enable-cache: true
27
+ cache-dependency-glob: pyproject.toml
28
+ cache-suffix: py${{ matrix.python_version }}
29
+
30
+ - name: Install dependencies (uv sync)
31
+ run: uv sync --all-extras --no-group docs
32
+
33
+ - name: Check for code issues (ruff check)
34
+ uses: astral-sh/ruff-action@v1
35
+
36
+ - name: Check code format (ruff format)
37
+ uses: astral-sh/ruff-action@v1
38
+ with:
39
+ args: "format --check"
40
+
41
+ - name: Static type checking (MyPy)
42
+ run: uv run --no-group docs mypy src/mcp_server_llmling/
43
+
44
+ - name: Run tests
45
+ run: uv run --no-group docs pytest --cov-report=xml --cov=src/mcp_server_llmling/ --cov-report=term-missing
46
+
47
+ - name: Upload test results to Codecov
48
+ uses: codecov/codecov-action@v5
49
+ with:
50
+ fail_ci_if_error: false
51
+ verbose: true
52
+
53
+ release:
54
+ runs-on: ubuntu-latest
55
+ needs: test
56
+ if: startsWith(github.ref, 'refs/tags/')
57
+ permissions:
58
+ # this permission is mandatory for trusted publishing
59
+ id-token: write
60
+ contents: write
61
+ steps:
62
+ - name: Check out repository
63
+ uses: actions/checkout@v4
64
+
65
+ - name: Set up Python
66
+ uses: actions/setup-python@v5
67
+ with:
68
+ python-version: "3.12"
69
+
70
+ - name: Install uv
71
+ uses: astral-sh/setup-uv@v4
72
+ with:
73
+ enable-cache: true
74
+ cache-dependency-glob: pyproject.toml
75
+ cache-suffix: py${{ matrix.python_version }}
76
+
77
+ - name: Build package
78
+ run: uv build
79
+
80
+ - name: Publish package distributions to PyPI
81
+ uses: pypa/gh-action-pypi-publish@release/v1
82
+
83
+ - name: Release package on GitHub
84
+ uses: ncipollo/release-action@v1
85
+ with:
86
+ body: ${{ github.event.head_commit.message }}
87
+ artifacts: dist/*.whl,dist/*.tar.gz
88
+ token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,57 @@
1
+ name: Build documentation
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9
+ permissions:
10
+ contents: read
11
+ pages: write
12
+ id-token: write
13
+
14
+ # Allow one concurrent deployment
15
+ concurrency:
16
+ group: "pages"
17
+ cancel-in-progress: true
18
+
19
+ # Default to bash
20
+ defaults:
21
+ run:
22
+ shell: bash
23
+
24
+ jobs:
25
+ build:
26
+ runs-on: ubuntu-latest
27
+
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ with:
31
+ fetch-depth: 0
32
+ - name: Set up Python
33
+ uses: actions/setup-python@v5
34
+ with:
35
+ python-version: "3.12"
36
+ - name: Install uv
37
+ uses: astral-sh/setup-uv@v4
38
+ - name: Install dependencies
39
+ run: |
40
+ uv sync --all-extras
41
+ - name: Build
42
+ run: uv run mknodes build
43
+ - name: Upload artifact
44
+ uses: actions/upload-pages-artifact@v3
45
+ with:
46
+ path: ./site
47
+
48
+ deploy:
49
+ environment:
50
+ name: github-pages
51
+ url: ${{ steps.deployment.outputs.page_url }}
52
+ runs-on: ubuntu-latest
53
+ needs: build
54
+ steps:
55
+ - name: Deploy to GitHub Pages
56
+ id: deployment
57
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,32 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ # Distribution / packaging
5
+ *.sublime-workspace
6
+ # Unit test / coverage reports
7
+ .coverage
8
+ coverage.xml
9
+ .cache
10
+ .hatch
11
+ .pytest_cache/
12
+ junit.xml
13
+ # Jupyter Notebook
14
+ .ipynb_checkpoints
15
+ # pyenv
16
+ .python-version
17
+ # dotenv
18
+ .env
19
+ # virtualenv
20
+ .venv
21
+ # mkdocs documentation
22
+ /site
23
+ # mypy
24
+ .mypy_cache/
25
+ # .vscode
26
+ .vscode/
27
+ # OS files
28
+ .DS_Store
29
+ # uv
30
+ uv.lock
31
+ # DiskCache cache file
32
+ ./model_cache
@@ -0,0 +1 @@
1
+ *
@@ -0,0 +1,6 @@
1
+ {
2
+ "token": "vjHbwdnM8TYPq4qhBltKBxjFb56Cdw6GP3mhjtbRtwh4",
3
+ "project_name": "mcp-server-llmling",
4
+ "project_url": "https://logfire.pydantic.dev/phil65/mcp-server-llmling",
5
+ "logfire_api_url": "https://logfire-api.pydantic.dev"
6
+ }
@@ -0,0 +1,48 @@
1
+ default_language_version:
2
+ python: python3.12
3
+ default_stages: [pre-commit]
4
+ repos:
5
+ - repo: local
6
+ hooks:
7
+ - id: pytest-check
8
+ name: pytest-check
9
+ entry: uv run pytest
10
+ language: system
11
+ # stages: [push]
12
+ types: [python]
13
+ pass_filenames: false
14
+ always_run: true
15
+
16
+ - repo: https://github.com/pre-commit/pre-commit-hooks
17
+ # https://pre-commit.com/hooks.html
18
+ rev: v5.0.0
19
+ hooks:
20
+ - id: check-added-large-files
21
+ - id: check-case-conflict
22
+ - id: check-merge-conflict
23
+ - id: check-toml
24
+ - id: check-json
25
+ - id: check-xml
26
+ - id: check-yaml
27
+ args: [--allow-multiple-documents, --unsafe]
28
+ - id: debug-statements
29
+ - id: detect-private-key
30
+
31
+ - repo: https://github.com/pre-commit/mirrors-mypy
32
+ rev: v1.13.0
33
+ hooks:
34
+ - id: mypy
35
+ additional_dependencies: [orjson, pydantic]
36
+
37
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
38
+ rev: v0.8.1
39
+ hooks:
40
+ - id: ruff
41
+ - id: ruff-format
42
+
43
+ - repo: https://github.com/commitizen-tools/commitizen
44
+ rev: v4.0.0
45
+ hooks:
46
+ - id: commitizen
47
+ stages: [commit-msg]
48
+ additional_dependencies: [typing-extensions]
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024, Philipp Temminghoff
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.
22
+
@@ -0,0 +1,314 @@
1
+ Metadata-Version: 2.3
2
+ Name: mcp-server-llmling
3
+ Version: 0.1.0
4
+ Summary: MCP (Model context protocol) server with LLMling backend
5
+ Project-URL: Documentation, https://phil65.github.io/mcp-server-llmling/
6
+ Project-URL: Source, https://github.com/phil65/mcp-server-llmling
7
+ Project-URL: Issues, https://github.com/phil65/mcp-server-llmling/issues
8
+ Project-URL: Discussions, https://github.com/phil65/mcp-server-llmling/discussions
9
+ Project-URL: Code coverage, https://app.codecov.io/gh/phil65/mcp-server-llmling
10
+ Author-email: Philipp Temminghoff <philipptemminghoff@googlemail.com>
11
+ License: MIT License
12
+
13
+ Copyright (c) 2024, Philipp Temminghoff
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all
23
+ copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ SOFTWARE.
32
+
33
+ Classifier: Development Status :: 4 - Beta
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: Operating System :: OS Independent
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3 :: Only
38
+ Classifier: Programming Language :: Python :: 3.12
39
+ Classifier: Programming Language :: Python :: 3.13
40
+ Classifier: Programming Language :: Python :: 3.14
41
+ Classifier: Topic :: Documentation
42
+ Classifier: Topic :: Software Development
43
+ Classifier: Topic :: Utilities
44
+ Classifier: Typing :: Typed
45
+ Requires-Python: >=3.12
46
+ Requires-Dist: fastapi>=0.115.6
47
+ Requires-Dist: llmling>=0.11.5
48
+ Requires-Dist: mcp>=1.1.0
49
+ Requires-Dist: pydantic
50
+ Description-Content-Type: text/markdown
51
+
52
+ # mcp-server-llmling
53
+
54
+ [![PyPI License](https://img.shields.io/pypi/l/mcp-server-llmling.svg)](https://pypi.org/project/mcp-server-llmling/)
55
+ [![Package status](https://img.shields.io/pypi/status/mcp-server-llmling.svg)](https://pypi.org/project/mcp-server-llmling/)
56
+ [![Daily downloads](https://img.shields.io/pypi/dd/mcp-server-llmling.svg)](https://pypi.org/project/mcp-server-llmling/)
57
+ [![Weekly downloads](https://img.shields.io/pypi/dw/mcp-server-llmling.svg)](https://pypi.org/project/mcp-server-llmling/)
58
+ [![Monthly downloads](https://img.shields.io/pypi/dm/mcp-server-llmling.svg)](https://pypi.org/project/mcp-server-llmling/)
59
+ [![Distribution format](https://img.shields.io/pypi/format/mcp-server-llmling.svg)](https://pypi.org/project/mcp-server-llmling/)
60
+ [![Wheel availability](https://img.shields.io/pypi/wheel/mcp-server-llmling.svg)](https://pypi.org/project/mcp-server-llmling/)
61
+ [![Python version](https://img.shields.io/pypi/pyversions/mcp-server-llmling.svg)](https://pypi.org/project/mcp-server-llmling/)
62
+ [![Implementation](https://img.shields.io/pypi/implementation/mcp-server-llmling.svg)](https://pypi.org/project/mcp-server-llmling/)
63
+ [![Releases](https://img.shields.io/github/downloads/phil65/mcp-server-llmling/total.svg)](https://github.com/phil65/mcp-server-llmling/releases)
64
+ [![Github Contributors](https://img.shields.io/github/contributors/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling/graphs/contributors)
65
+ [![Github Discussions](https://img.shields.io/github/discussions/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling/discussions)
66
+ [![Github Forks](https://img.shields.io/github/forks/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling/forks)
67
+ [![Github Issues](https://img.shields.io/github/issues/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling/issues)
68
+ [![Github Issues](https://img.shields.io/github/issues-pr/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling/pulls)
69
+ [![Github Watchers](https://img.shields.io/github/watchers/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling/watchers)
70
+ [![Github Stars](https://img.shields.io/github/stars/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling/stars)
71
+ [![Github Repository size](https://img.shields.io/github/repo-size/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling)
72
+ [![Github last commit](https://img.shields.io/github/last-commit/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling/commits)
73
+ [![Github release date](https://img.shields.io/github/release-date/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling/releases)
74
+ [![Github language count](https://img.shields.io/github/languages/count/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling)
75
+ [![Github commits this week](https://img.shields.io/github/commit-activity/w/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling)
76
+ [![Github commits this month](https://img.shields.io/github/commit-activity/m/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling)
77
+ [![Github commits this year](https://img.shields.io/github/commit-activity/y/phil65/mcp-server-llmling)](https://github.com/phil65/mcp-server-llmling)
78
+ [![Package status](https://codecov.io/gh/phil65/mcp-server-llmling/branch/main/graph/badge.svg)](https://codecov.io/gh/phil65/mcp-server-llmling/)
79
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
80
+ [![PyUp](https://pyup.io/repos/github/phil65/mcp-server-llmling/shield.svg)](https://pyup.io/repos/github/phil65/mcp-server-llmling/)
81
+
82
+ [Read the documentation!](https://phil65.github.io/mcp-server-llmling/)
83
+
84
+
85
+
86
+ # LLMling Server Manual
87
+
88
+
89
+ ## Overview
90
+
91
+ mcp-server-llmling is a server for the Machine Chat Protocol (MCP) that provides a YAML-based configuration system for LLM applications.
92
+
93
+ LLMLing, the backend, provides a YAML-based configuration system for LLM applications.
94
+ It allows to set up custom MPC servers serving content defined in YAML files.
95
+
96
+ - **Static Declaration**: Define your LLM's environment in YAML - no code required
97
+ - **MCP Protocol**: Built on the Machine Chat Protocol (MCP) for standardized LLM interaction
98
+ - **Component Types**:
99
+ - **Resources**: Content providers (files, text, CLI output, etc.)
100
+ - **Prompts**: Message templates with arguments
101
+ - **Tools**: Python functions callable by the LLM
102
+
103
+ The YAML configuration creates a complete environment that provides the LLM with:
104
+ - Access to content via resources
105
+ - Structured prompts for consistent interaction
106
+ - Tools for extending capabilities
107
+
108
+
109
+ ## Key Features
110
+
111
+ ### 1. Resource Management
112
+ - Load and manage different types of resources:
113
+ - Text files (`PathResource`)
114
+ - Raw text content (`TextResource`)
115
+ - CLI command output (`CLIResource`)
116
+ - Python source code (`SourceResource`)
117
+ - Python callable results (`CallableResource`)
118
+ - Images (`ImageResource`)
119
+ - Support for resource watching/hot-reload
120
+ - Resource processing pipelines
121
+ - URI-based resource access
122
+
123
+ ### 2. Tool System
124
+ - Register and execute Python functions as LLM tools
125
+ - Support for OpenAPI-based tools
126
+ - Entry point-based tool discovery
127
+ - Tool validation and parameter checking
128
+ - Structured tool responses
129
+
130
+ ### 3. Prompt Management
131
+ - Static prompts with template support
132
+ - Dynamic prompts from Python functions
133
+ - File-based prompts
134
+ - Prompt argument validation
135
+ - Completion suggestions for prompt arguments
136
+
137
+ ### 4. Multiple Transport Options
138
+ - Stdio-based communication (default)
139
+ - Server-Sent Events (SSE) for web clients
140
+ - Support for custom transport implementations
141
+
142
+
143
+
144
+
145
+ ## Usage
146
+
147
+ ### With Zed Editor
148
+
149
+ Add LLMLing as a context server in your `settings.json`:
150
+
151
+ ```json
152
+ {
153
+ "context_servers": {
154
+ "llmling": {
155
+ "command": {
156
+ "env": {},
157
+ "label": "llmling",
158
+ "path": "uvx",
159
+ "args": [
160
+ "mcp-server-llmling",
161
+ "path/to/your/config.yml"
162
+ ]
163
+ },
164
+ "settings": {}
165
+ }
166
+ }
167
+ }
168
+ ```
169
+
170
+ ### With Claude Desktop
171
+
172
+ Configure LLMLing in your `claude_desktop_config.json`:
173
+
174
+ ```json
175
+ {
176
+ "mcpServers": {
177
+ "llmling": {
178
+ "command": "uvx",
179
+ "args": [
180
+ "mcp-server-llmling",
181
+ "path/to/your/config.yml"
182
+ ],
183
+ "env": {}
184
+ }
185
+ }
186
+ }
187
+ ```
188
+
189
+ ### Manual Server Start
190
+
191
+ Start the server directly from command line:
192
+
193
+ ```bash
194
+ # Latest version
195
+ uvx mcp-server-llmling@latest
196
+ ```
197
+
198
+ ### 1. Programmatic usage
199
+
200
+ ```python
201
+ from llmling import Config, LLMLingServer
202
+
203
+ # Load configuration
204
+ config = Config.from_file("config.yml")
205
+
206
+ # Create and start server
207
+ async with LLMLingServer(config) as server:
208
+ await server.start()
209
+ ```
210
+
211
+ ### 2. Using Custom Transport
212
+
213
+ ```python
214
+ from llmling import Config, LLMLingServer
215
+
216
+ config = Config.from_file("config.yml")
217
+ server = LLMLingServer(
218
+ config,
219
+ transport="sse",
220
+ transport_options={
221
+ "host": "localhost",
222
+ "port": 8000,
223
+ "cors_origins": ["http://localhost:3000"]
224
+ }
225
+ )
226
+ await server.start()
227
+ ```
228
+
229
+ ### 3. Resource Configuration
230
+
231
+ ```yaml
232
+ resources:
233
+ python_code:
234
+ type: path
235
+ path: "./src/**/*.py"
236
+ watch:
237
+ enabled: true
238
+ patterns:
239
+ - "*.py"
240
+ - "!**/__pycache__/**"
241
+
242
+ api_docs:
243
+ type: text
244
+ content: |
245
+ API Documentation
246
+ ================
247
+ ...
248
+ ```
249
+
250
+ ### 4. Tool Configuration
251
+
252
+ ```yaml
253
+ tools:
254
+ analyze_code:
255
+ import_path: "mymodule.tools.analyze_code"
256
+ description: "Analyze Python code structure"
257
+
258
+ toolsets:
259
+ api:
260
+ type: openapi
261
+ spec: "https://api.example.com/openapi.json"
262
+ namespace: "api"
263
+ ```
264
+
265
+ ## Server Configuration
266
+
267
+ The server is configured through a YAML file with the following sections:
268
+
269
+ ```yaml
270
+ global_settings:
271
+ timeout: 30
272
+ max_retries: 3
273
+ log_level: "INFO"
274
+ requirements: []
275
+ pip_index_url: null
276
+ extra_paths: []
277
+
278
+ resources:
279
+ # Resource definitions...
280
+
281
+ tools:
282
+ # Tool definitions...
283
+
284
+ toolsets:
285
+ # Toolset definitions...
286
+
287
+ prompts:
288
+ # Prompt definitions...
289
+ ```
290
+
291
+ ## Interaction Protocol
292
+
293
+ The server implements the MCP protocol which supports:
294
+
295
+ 1. **Resource Operations**
296
+ - List available resources
297
+ - Read resource content
298
+ - Watch for resource changes
299
+
300
+ 2. **Tool Operations**
301
+ - List available tools
302
+ - Execute tools with parameters
303
+ - Get tool schemas
304
+
305
+ 3. **Prompt Operations**
306
+ - List available prompts
307
+ - Get formatted prompts
308
+ - Get completions for prompt arguments
309
+
310
+ 4. **Notifications**
311
+ - Resource changes
312
+ - Tool/prompt list updates
313
+ - Progress updates
314
+ - Log messages