Skip to content

Conversation

@beonde
Copy link
Member

@beonde beonde commented Jan 18, 2026

Summary

Adds MCPClient to the Python SDK for MCP security operations via capiscio-core gRPC.

Changes

New Features

  • MCPClient in capiscio_sdk._rpc.client with methods:

    • evaluate_tool_access() - RFC-006 §6.2-6.4: Evaluate tool access and emit evidence
    • verify_server_identity() - RFC-007 §7.2: Verify server identity from DID + badge
    • parse_server_identity_http() - RFC-007 §5.2: Extract identity from HTTP headers
    • parse_server_identity_jsonrpc() - RFC-007 §5.3: Extract identity from JSON-RPC _meta
    • health() - Service health and version check
  • Generated protobuf stubs for MCP service (mcp_pb2.py, mcp_pb2_grpc.py)

Documentation

  • New guide: docs/guides/mcp.md documenting the low-level gRPC MCPClient API
  • Updated api-reference.md with MCPClient API documentation
  • Added note directing users to capiscio-mcp-python for high-level decorators

Tests

  • Integration tests for MCPClient against live gRPC server (in tests/integration/test_mcp_service.py)
  • Tests skipped in CI workflow (requires capiscio-core gRPC server)

RFC References

Related PRs

  • capiscio-core#30 - MCP service implementation (merged)
  • capiscio-mcp-python#2 - High-level MCP integration library

Testing

  • Unit tests pass locally
  • Integration tests pass (with capiscio-core running)
  • Documentation builds successfully

- Add MCP service client methods to _rpc/client.py
- Add mcp_pb2 imports to gen/__init__.py
- Update protobuf generated files for MCP service
- Add docs/guides/mcp.md guide
- Add integration tests for MCP service
- Update API reference and mkdocs nav
- Add Generator return type annotation to start_badge_keeper in badge.py
- Add Generator return type annotation to start_keeper in client.py
- Fix Google-style docstring format for Yields section
- Configure mkdocstrings options for better compatibility
These files were ignored by .gitignore but are required for MCP service support.
The test_mcp_service.py tests require capiscio-core gRPC server running
on localhost:50051, which is not set up in the Docker Compose integration
test environment. These tests are better suited for E2E testing with
full infrastructure.
The previous mcp.md documented a high-level capiscio_sdk.mcp API that doesn't
exist. The SDK only provides the low-level gRPC MCPClient via _rpc.client.

Changes:
- Rewrite mcp.md to document the actual MCPClient gRPC methods
- Add note directing users to capiscio-mcp-python for high-level API
- Update mkdocs nav title from 'MCP Security' to 'MCP Service (gRPC)'

Addresses PR review feedback about documentation/API mismatch.
Copilot AI review requested due to automatic review settings January 18, 2026 02:55
Signed-off-by: Beon de Nood <77057717+beonde@users.noreply.github.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the MCPClient to the Python SDK for MCP security operations via capiscio-core gRPC, implementing RFC-006 (Tool Authority) and RFC-007 (Server Identity) operations.

Changes:

  • Adds new MCPClient class with methods for tool access evaluation, server identity verification, and identity parsing from HTTP/JSON-RPC transports
  • Includes comprehensive integration tests (377 lines) covering all MCP operations and edge cases
  • Adds detailed documentation guide and API reference updates for the new MCP service client

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Show a summary per file
File Description
capiscio_sdk/_rpc/client.py Implements MCPClient with 5 methods for RFC-006/RFC-007 operations, integrates with CapiscioRPCClient
capiscio_sdk/_rpc/gen/capiscio/v1/mcp_pb2.py Generated protobuf Python bindings for MCP service messages
capiscio_sdk/_rpc/gen/capiscio/v1/mcp_pb2_grpc.py Generated gRPC stub for MCPService with 4 RPC methods
capiscio_sdk/_rpc/gen/capiscio/v1/__init__.py Adds MCP protobuf imports to module exports
capiscio_sdk/_rpc/gen/capiscio/v1/*_pb2.py Updates protobuf version from 6.33.2 to 6.33.4 across existing files
capiscio_sdk/badge.py Adds Generator type hint to start_badge_keeper return type
tests/integration/test_mcp_service.py Comprehensive integration tests for all MCP operations with 6 test classes
docs/guides/mcp.md New 283-line guide documenting MCPClient low-level gRPC API usage
docs/api-reference.md Adds API documentation sections for MCPClient and other RPC clients
mkdocs.yml Adds MCP guide to navigation and updates mkdocstrings configuration
.github/workflows/integration-tests.yml Excludes MCP integration tests from CI (requires running gRPC server)

@github-actions
Copy link

✅ Documentation validation passed!

Unified docs will be deployed from capiscio-docs repo.

@github-actions
Copy link

✅ All checks passed! Ready for review.

@codecov
Copy link

codecov bot commented Jan 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@beonde beonde merged commit bae3457 into main Jan 18, 2026
10 checks passed
@beonde beonde deleted the feature/mcp-service-client branch January 18, 2026 03:00
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.

2 participants