Skip to content

Model context protocol (MCP) server#165

Merged
pebenito merged 4 commits into
SELinuxProject:mainfrom
pebenito:mcp
May 22, 2026
Merged

Model context protocol (MCP) server#165
pebenito merged 4 commits into
SELinuxProject:mainfrom
pebenito:mcp

Conversation

@pebenito
Copy link
Copy Markdown
Member

@pebenito pebenito commented May 21, 2026

  • Added a new tool, setools-mcp, which acts as an MCP (Model Context Protocol) server to expose SETools policy analysis capabilities to LLMs and other AI tools.
  • Added the mcp package as an optional dependency for AI tools in pyproject.toml.
  • Added a from_class classmethod to GenfsFiletype to create filetype objects from object classes, improving the handling of genfscon rules.
  • Improved the BaseTERule class to have consistent behavior of the extended and xperm_type properties across all subclasses.

pebenito added 4 commits May 14, 2026 13:49
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
This is to handle extended permissions generally, and to raise
RuleUseError on standard rules.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
Support sesearch, seinfo, sedta, and seinfoflow as MCP tools.

Policy loading behavior:
1. Explicit policy_path argument
2. --policy PATH at server startup
3. Fallback to running system policy

Policies are cached in memory to avoid repeated parse overhead.

Usage:
* stdio (Desktop)
setools-mcp --policy /etc/selinux/targeted/policy/policy.33

* SSE (HTTP clients)
setools-mcp --transport sse --host 0.0.0.0 --port 8000

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
@pebenito pebenito merged commit 0448435 into SELinuxProject:main May 22, 2026
11 checks passed
@pebenito pebenito deleted the mcp branch May 22, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant