Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
2927f7e
Add ToolRegistry (#4)
mateusz834 Dec 15, 2025
64a26a4
Bump actions/checkout from 6.pre.beta to 6.0.1
dependabot[bot] Dec 15, 2025
4420ca9
Bump actions/setup-python from 6.0.0 to 6.1.0
dependabot[bot] Dec 15, 2025
6031efc
Bump actions/upload-artifact from 5.0.0 to 6.0.0
dependabot[bot] Dec 15, 2025
8ba4db1
Merge pull request #8 from splunk/dependabot/github_actions/develop/a…
Ickerday Dec 16, 2025
6ac0014
Merge pull request #3 from splunk/dependabot/github_actions/develop/a…
Ickerday Dec 16, 2025
5b94671
Merge pull request #1 from splunk/dependabot/github_actions/develop/a…
Ickerday Dec 16, 2025
bf9d92f
feat(DVPL-12696): Agentic Apps in Splunk
szykol Dec 2, 2025
a0e098a
Merge pull request #6 from splunk/skolton/DVPL-12696
szykol Dec 17, 2025
6bc2dd8
Support remote and local tool execution over MCP (#9)
mateusz834 Dec 19, 2025
664bbb2
Add additional parameter support to Agents (#10)
szykol Jan 12, 2026
adbe024
Make the agent async (#12)
mateusz834 Jan 12, 2026
ae98577
Add remote MCP tools tests (#13)
mateusz834 Jan 12, 2026
a0d1dd8
Add property fields to BaseAgent (#14)
szykol Jan 14, 2026
613b4f6
Add Loop Stop Conditions (#11)
szykol Jan 15, 2026
1ca1e23
Add parameters to the OpenAIModel (#20)
szykol Jan 21, 2026
6f1f436
Add Tool type and decouple Agent from langchain (#18)
szykol Jan 21, 2026
1d2cd11
Remove OllamaModel (#21)
szykol Jan 22, 2026
302befb
Add E2E tests - Agent used inside of an App (#17)
mateusz834 Jan 22, 2026
e812b58
Require service to be provided in Agent constructor (#23)
mateusz834 Jan 26, 2026
c64c955
Remove "/deps" from .gitignore (#24)
mateusz834 Jan 26, 2026
bf3bb8c
Bump actions/setup-python from 6.1.0 to 6.2.0
dependabot[bot] Jan 27, 2026
7219546
Bump actions/checkout from 6.0.1 to 6.0.2
dependabot[bot] Jan 27, 2026
8b5db88
Merge pull request #26 from splunk/dependabot/github_actions/develop/…
Ickerday Jan 27, 2026
280941a
Merge pull request #25 from splunk/dependabot/github_actions/develop/…
Ickerday Jan 27, 2026
b0693b9
Implement tool filtering (#19)
Ickerday Jan 28, 2026
257fe31
Refactor Message handling (#28)
szykol Jan 29, 2026
1458085
Don't require input schema in subagents (#30)
mateusz834 Jan 29, 2026
411c7fb
Add Agentic SDK docs (#27)
mateusz834 Jan 29, 2026
0c495d7
Add missing docstrings in Agentic SDK (#29)
mateusz834 Jan 29, 2026
182755b
Organize imports (#31)
szykol Jan 29, 2026
f07cf3d
Add AppInspect info to docs (#34)
szykol Jan 29, 2026
cd74a81
Update dev environment (#32)
Ickerday Jan 30, 2026
6823095
Agentic SDK fix typo (#37)
mateusz834 Feb 2, 2026
ed3397b
Add extra_body and httpx_client params to OpenAIModel (#33)
mateusz834 Feb 2, 2026
786e92d
Use min_length/max_length instead of min_items/max_items (#36)
mateusz834 Feb 2, 2026
cbc573d
Remove types.py file (#38)
mateusz834 Feb 2, 2026
47b01d5
Remove duplicated section from README (#39)
mateusz834 Feb 2, 2026
9e969e2
Run Agentic SDK tests in CI (#35)
mateusz834 Feb 3, 2026
4f88055
Raise an exception on duplicated subagent names (#41)
mateusz834 Feb 4, 2026
c90ecdc
Update README.md (#42)
szykol Feb 4, 2026
42bec3a
Make the tool name non-optional in ToolMessage (#43)
mateusz834 Feb 5, 2026
f0d7430
Handle collisions between tools and subagents names better (#44)
mateusz834 Feb 5, 2026
0d0bbc2
Support async local tools (#48)
mateusz834 Feb 6, 2026
1577899
Add hooks (#45)
szykol Feb 6, 2026
745cd96
Use get("SSL_CERT_FILE") instead of index access (#55)
mateusz834 Feb 12, 2026
8e222bd
Fix splunklib.ai.messages imports in README (#56)
mateusz834 Feb 12, 2026
9304de2
Propagate trace_id & app_id to MCP (#49)
mateusz834 Feb 17, 2026
a9cbdc7
Expose Logger in ToolContext (#50)
mateusz834 Feb 17, 2026
8a18fe5
Add logger to Agent (#51)
mateusz834 Feb 17, 2026
86f473d
Cleanup ToolContext construction logic (#57)
mateusz834 Feb 17, 2026
93bfe32
Adjust top-level comments in AI module (#46)
Ickerday Feb 17, 2026
661e0d9
Pass structured_content to LLM even when content is set (#62)
mateusz834 Feb 23, 2026
bbdedea
Use services/mcp_token for retrieving auth token for MCP (#63)
mateusz834 Feb 23, 2026
7e1ec18
Don't use tokens to create a Service in local tools (#64)
mateusz834 Feb 23, 2026
b4d2c66
Support async hooks (#65)
mateusz834 Feb 25, 2026
a1eae32
Drop name field of hooks (#67)
mateusz834 Feb 25, 2026
71ffc60
Adjust rules for basedpyright and ruff (#58)
Ickerday Feb 25, 2026
3e3508a
Add example AI Custom Search app (#61)
Ickerday Feb 25, 2026
b6ecd4d
Keep MCP alive during entire Agent lifetime (#68)
mateusz834 Feb 27, 2026
8171f30
Fix errors and warnings in test_langchain_backend.py (#70)
Ickerday Feb 27, 2026
43d6e0f
Fix test_list_with_sort_dir (#74)
mateusz834 Mar 3, 2026
442e3f9
Set _agent_context_manager to None in __aexit__ (#72)
mateusz834 Mar 3, 2026
daf8f05
Introduce middleware (#69)
szykol Mar 3, 2026
92024ec
Bump actions/upload-artifact from 6.0.0 to 7.0.0 (#73)
dependabot[bot] Mar 3, 2026
6aed443
Add lint stage (#22)
Ickerday Mar 3, 2026
75899b0
Adjustments in tool_filtering.py (#71)
Ickerday Mar 3, 2026
6a6178b
Fix convertion type errors in langchain backend (#76)
szykol Mar 3, 2026
6204403
Turn on `combine-as-imports` in Ruff (#75)
Ickerday Mar 3, 2026
1119dc9
Resolve warnings in test_middleware.py (#77)
Ickerday Mar 4, 2026
2236203
Move AgentState to splunklib.ai.middleware (#79)
mateusz834 Mar 6, 2026
f63d44f
Add agent middleware (#78)
mateusz834 Mar 6, 2026
04dfeb6
Propagate structured outputs in model middleware (#81)
mateusz834 Mar 6, 2026
644fdc4
Implement Hooks as middlewares (#80)
mateusz834 Mar 6, 2026
1bc49be
Handle name collisions between local and remote tools (#52)
Ickerday Mar 6, 2026
e05fe84
Bump packages to resolve CVEs (#87)
Ickerday Mar 10, 2026
8070585
Add example AI Custom Alert app (#59)
Ickerday Mar 11, 2026
a29ff65
Add example AI Modular Input app (#60)
Ickerday Mar 11, 2026
284d8b8
Bump astral-sh/setup-uv (#83)
dependabot[bot] Mar 11, 2026
884a508
Drop default values of message types (#89)
mateusz834 Mar 12, 2026
281c9a9
Simplify Middleware implementation (#90)
mateusz834 Mar 12, 2026
e7e0b02
Add Anthropic model support (#86)
szykol Mar 12, 2026
818bc63
Make subagents work with output schema, but without input schema. (#91)
mateusz834 Mar 13, 2026
6a686d0
Change key creation strategy for CI/CD `pytest` cache (#88)
Ickerday Mar 13, 2026
a27eec9
Fix warnings in test_registry_unit.py, improve typing in ToolRegistry…
Ickerday Mar 17, 2026
b47835f
Bump astral-sh/setup-uv (#95)
dependabot[bot] Mar 18, 2026
31801e7
Rework subagent and tool response messages (#92)
mateusz834 Mar 19, 2026
875e05f
Add an E2E test with Splunk MCP Server App (#85)
mateusz834 Mar 19, 2026
b85dd7b
Add defaults to ToolFilters (#93)
Ickerday Mar 20, 2026
733527f
Implement tool name restrictions from the MCP spec (#97)
Ickerday Mar 23, 2026
eaf674f
Audit logging (#98)
szykol Mar 24, 2026
f4a9529
Fix warnings in test_middleware.py (#112)
Ickerday Mar 30, 2026
6d0c28a
Bump all packages, update makefile, uv.lock (#113)
Ickerday Mar 30, 2026
806da0b
Make middleware-types read only. (#106)
mateusz834 Mar 31, 2026
f8a1daf
Add ConversationStore (#96)
mateusz834 Apr 1, 2026
7e8d1c3
Move LC agent construction logic to the constructor (#108)
mateusz834 Apr 1, 2026
8181104
Reflect unstructured inputs in SubagentCall.args (#110)
mateusz834 Apr 1, 2026
eb05701
Populate artifact for subagent failures (#116)
mateusz834 Apr 2, 2026
fd2b744
Add prompt injection mitigation methods (#115)
szykol Apr 2, 2026
c890583
Allow resumption of subagents (#102)
mateusz834 Apr 2, 2026
1d6da28
Use invoke_with_data during subagent invocation (#117)
mateusz834 Apr 2, 2026
e278e44
Add AGENTS.md and CLAUDE.md (#105)
szykol Apr 2, 2026
460d0e5
Tool settings revamp (#111)
Ickerday Apr 2, 2026
3026733
Use single LC middleware for SDK middlewares (#120)
mateusz834 Apr 10, 2026
1bae6e2
Fix middleware state changes (#122)
szykol Apr 13, 2026
099a4d6
Add sane default limits to Agents (#118)
szykol Apr 14, 2026
7679487
Add Python scans to dependabot (#126)
Ickerday Apr 14, 2026
fdf42a0
Remove fossa scan (#124)
Ickerday Apr 14, 2026
be95d64
Pass all env to tools.py (#140)
mateusz834 Apr 15, 2026
10b1752
Support models that require tool strategy. (#103)
mateusz834 Apr 15, 2026
9b9fb52
Improve docs regarding security (#119)
szykol Apr 15, 2026
af963a6
Fix botched gitignore rules (#139)
Ickerday Apr 15, 2026
88e048f
Debug mode (#121)
mateusz834 Apr 15, 2026
fd70297
Test concurrency groups in the test pipeline (#132)
Ickerday Apr 15, 2026
e345584
fix(tool_registry): Support plain dict as return types of local tools…
szykol Apr 15, 2026
505b724
Validate messages before and after the agent loop (#142)
mateusz834 Apr 15, 2026
8f0b229
Update CI/CD workflows (#125)
Ickerday Apr 15, 2026
c919723
Merge all changes from pre-3.0 develop branch
Ickerday Apr 15, 2026
cbf62be
Regenerate basedpyright baseline
Ickerday Apr 15, 2026
37d3825
Adjust workflow stage names
Ickerday Apr 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47,924 changes: 47,924 additions & 0 deletions .basedpyright/baseline.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .env → .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ version=9.0
#splunkToken="<Bearer-token>"
# Session key for authentication
#token="<Session-Key>"

#internal_ai_client_id=""
#internal_ai_client_secret=""
#internal_ai_app_key=""
#internal_ai_token_url=""
#internal_ai_base_url=""
22 changes: 22 additions & 0 deletions .github/actions/setup-sdk-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Set up SDK environment
description: Perform all the shared setup steps

inputs:
python-version:
description: Python version used for this run
required: true
deps-group:
description: Dependency groups passed to `uv sync --group`
required: true

runs:
using: composite
steps:
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57
with:
version: 0.11.6
activate-environment: true
python-version: ${{ inputs.python-version }}
- name: Install dependencies from the ${{ inputs.deps-group }} group(s)
run: SDK_DEPS_GROUP="${{ inputs.deps-group }}" make uv-sync-ci
shell: bash
4 changes: 4 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ updates:
target-branch: "develop"
schedule:
interval: "weekly"
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"
7 changes: 0 additions & 7 deletions .github/workflows/fossa.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Python SDK Lint
on: [push, workflow_dispatch]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- uses: ./.github/actions/setup-sdk-environment
with:
python-version: ${{ matrix.python-version }}
deps-group: lint
- name: Verify uv.lock is up-to-date
run: uv lock --check
- name: Verify against basedpyright baseline
run: uv run --frozen basedpyright
15 changes: 6 additions & 9 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,23 @@ name: Publish SDK to Test PyPI
on: [workflow_dispatch]

env:
PYTHON_VERSION: 3.9
PYTHON_VERSION: 3.13

jobs:
publish-sdk-test-pypi:
publish-to-test-pypi:
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: splunk-test-pypi
steps:
- name: Checkout source
uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- uses: ./.github/actions/setup-sdk-environment
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: python -m pip install . --group build
deps-group: release
- name: Build packages for distribution
run: python -m build
run: uv build
- name: Publish packages to Test PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
with:
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,31 @@ on:
types: [published]

env:
PYTHON_VERSION: 3.9
PYTHON_VERSION: 3.13

jobs:
publish-sdk-pypi:
publish-to-pypi:
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: splunk-pypi
steps:
- name: Checkout source
uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- uses: ./.github/actions/setup-sdk-environment
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: python -m pip install . --group release
deps-group: release
- name: Build packages for distribution
run: python -m build
run: uv build
- name: Publish packages to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
with:
repository-url: https://test.pypi.org/legacy/
- name: Generate API reference
run: make -C ./docs html
- name: Upload docs artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: python-sdk-docs
path: docs/_build/html
70 changes: 43 additions & 27 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,55 @@
name: Python CI
name: Python SDK CI
on: [push, workflow_dispatch]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
run-test-suite:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.9]
splunk-version: [9.4, latest]
include:
# Oldest possible configuration
# Last Ubuntu version with Python 3.7 binaries available
- os: ubuntu-22.04
python-version: 3.7
splunk-version: 9.1
# Latest possible configuration
- os: ubuntu-latest
python-version: 3.13
splunk-version: latest
python-version: [3.13]
splunk-version: [latest]
steps:
- name: Checkout code
uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- uses: ./.github/actions/setup-sdk-environment
with:
python-version: ${{ matrix.python-version }}
deps-group: test
- name: Download Splunk MCP Server App
run: uv run ./scripts/download_splunk_mcp_server_app.py
env:
SPLUNKBASE_USERNAME: ${{ secrets.SPLUNKBASE_USERNAME }}
SPLUNKBASE_PASSWORD: ${{ secrets.SPLUNKBASE_PASSWORD }}
- name: Launch Splunk Docker instance
run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
- name: Set up .env
run: cp .env.template .env
- name: Write internal AI secrets to .env
run: |
echo "internal_ai_app_key=$INTERNAL_AI_APP_KEY" >> .env
echo "internal_ai_client_id=$INTERNAL_AI_CLIENT_ID" >> .env
echo "internal_ai_client_secret=$INTERNAL_AI_CLIENT_SECRET" >> .env
echo "internal_ai_token_url=$INTERNAL_AI_TOKEN_URL" >> .env
echo "internal_ai_base_url=$INTERNAL_AI_BASE_URL" >> .env
env:
INTERNAL_AI_APP_KEY: ${{ secrets.INTERNAL_AI_APP_KEY }}
INTERNAL_AI_CLIENT_ID: ${{ secrets.INTERNAL_AI_CLIENT_ID }}
INTERNAL_AI_CLIENT_SECRET: ${{ secrets.INTERNAL_AI_CLIENT_SECRET }}
INTERNAL_AI_TOKEN_URL: ${{ secrets.INTERNAL_AI_TOKEN_URL }}
INTERNAL_AI_BASE_URL: ${{ secrets.INTERNAL_AI_BASE_URL }}
- name: Restore pytest cache
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop' }}
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
with:
python-version: ${{ matrix.python-version }}
- name: (Python 3.7) Install dependencies
if: ${{ matrix.python-version == '3.7' }}
run: python -m pip install python-dotenv pytest
- name: (Python >= 3.9) Install dependencies
if: ${{ matrix.python-version != '3.7' }}
run: python -m pip install . --group test
path: .pytest_cache
key: pytest-cache-${{ runner.os }}-py${{ matrix.python-version }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
pytest-cache-${{ runner.os }}-py${{ matrix.python-version }}-${{ github.ref_name }}-
- name: Run unit tests
run: make test-unit
- name: Run entire test suite
run: python -m pytest ./tests
run: make test-integration
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,11 @@ $RECYCLE.BIN/
# End of https://www.toptal.com/developers/gitignore/api/windows,macos,linux,pycharm+all,python

.vscode/
docs/_build/
docs/_build/

!*.conf.spec
**/metadata/local.meta

*.spl
*.tgz
*.tar*
69 changes: 69 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Repository Guidelines

## Project Structure & Module Organization

- Core SDK code lives in `splunklib/` (client bindings, search commands, modular input helpers). Keep new modules close to their domain peers (e.g., searchcommand utilities under `splunklib/searchcommands`).
- `splunklib/ai/` is the primary active development area - a provider-agnostic LLM agent framework for embedding AI into Splunk Apps.
- Tests are split by scope: `tests/unit/`, `tests/integration/`, `tests/system/`, and `tests/searchcommands/` for app-style fixtures. Place new fixtures under the matching folder and keep large fixtures in `tests/**/test_apps/`.

## Package Manager

This project uses [`uv`](https://docs.astral.sh/uv/) for dependency management and running Python tools. All Python and pytest invocations should be prefixed with `uv run`. Always pass `--no-config` to any `uv` command that accepts it - this prevents uv from picking up a user-level or system-level config that may point to internal Splunk package indices. To install/sync dependencies:

```sh
make uv-sync
```

If you manually edit `pyproject.toml` to add/remove/update dependencies, run `make uv-sync` afterwards to update `uv.lock`.

The `Makefile` wraps `uv` commands - prefer `make` targets over invoking `uv` directly where a target exists.

## Build, Test, and Development Commands

See the `Makefile` for all available targets. Common ones:

- `make uv-sync` - set up / update virtualenv
- `make test` - run the full pytest suite.
- `make test-unit` - unit tests only; fastest feedback loop.
- `make test-integration` - integration + system coverage; requires Splunk services available (see docker targets).
- `make test-ai` - AI subsystem tests only.
- `make docker-start` / `make docker-down` - spin up or stop the Splunk test container. Make sure the instance is live before running integration tests.

## Coding Style, Rules & Naming Conventions

- Python 3.13+.
- Ruff is the linter/formatter. isort is configured with `combine-as-imports = true`.
- Type checking uses `basedpyright`.
- Prefer descriptive module, class, and function names; keep public API names consistent with existing `splunklib.*` patterns.
- Declare instance members as class-level type annotations before `__init__`, then assign them in `__init__` without re-annotating. This matches the pattern used throughout `splunklib/ai/`.
- Docstrings should be concise and actionable.
- Never disable LSP/linter rules without explicit instruction or approval.
- Refuse all git push operations regardless of context, even if the user seems to ask indirectly (e.g. "publish this", "send this upstream"). If the user wants to push, they do it themselves.

**After editing any Python file**, format it:

```sh
# Sort imports, then format
uv run ruff check --fix $FILE
uv run ruff format $FILE
```

**Before declaring a change done**, run:

```sh
# linter
uv run basedpyright

# testing
make test-unit
make test-ai
```

New code must not introduce new `basedpyright`/`ruff` errors or warnings.
You're not allowed to modify `.basedpyright/baseline.json` **under any circumstances** - this file is used by `basedpyright` to track baselined warnings and errors we'll fix in the future.
New code must not introduce regressions in tests.

### Writing style

Be concise and direct in your responses.
Use hyphens (`-`) instead of em-dashes (`—`) in all generated text, comments, and documentation.
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# CLAUDE.md

The core file containing repository guidelines for Agents is located in `AGENTS.md` file.
Use this file as your guidelines.
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ARG SPLUNK_VERSION=latest
FROM splunk/splunk:${SPLUNK_VERSION}

USER root

# Copy splunk-mcp-server.tgz, we need to copy entire sdk since
# splunk-mcp-server.tgz might not exist and we don't want to fail in such case.
RUN mkdir /tmp/sdk
COPY . /tmp/sdk
RUN /bin/bash -c 'if [ -f /tmp/sdk/splunk-mcp-server.tgz ]; then cp /tmp/sdk/splunk-mcp-server.tgz /splunk-mcp-server.tgz; fi'
RUN rm -rf /tmp/sdk

RUN mkdir /tmp/sdk
COPY ./pyproject.toml /tmp/sdk/pyproject.toml
COPY ./uv.lock /tmp/sdk/uv.lock
COPY ./splunklib /tmp/sdk/splunklib

RUN mkdir /splunklib-deps
RUN chown splunk:splunk /splunklib-deps
RUN chown -R splunk:splunk /tmp/sdk
RUN chown splunk:splunk /tmp/sdk

USER splunk

WORKDIR /tmp/sdk

RUN /opt/splunk/bin/python3.13 -m venv .venv
RUN /bin/bash -c "source .venv/bin/activate && LD_LIBRARY_PATH=/opt/splunk/lib python -m pip install '.[openai]' --target=/splunklib-deps"

USER ${ANSIBLE_USER}
WORKDIR /opt/splunk
Loading
Loading