Skip to content

Conversation

@SangameshV
Copy link
Contributor

This PR merges the copilot/add-json-rpc-server-for-fcli branch into sangamesh/latest-mcp-json-rpc-impl, bringing in the complete JSON-RPC 2.0 server implementation for IDE plugin integration.

Copilot AI and others added 9 commits November 26, 2025 05:03
Implements a lightweight JSON-RPC 2.0 server accessible via 'fcli util rpc-server start'.
This provides programmatic access to fcli functionality for IDE plugins.

Key features:
- Custom JSON-RPC 2.0 implementation (no external dependencies, GraalVM compatible)
- RPC methods: fcli.execute, fcli.listCommands, fcli.version, rpc.listMethods
- Pagination support for record-producing commands
- Structured JSON responses for IDE integration

Reuses patterns from MCP server implementation.

Co-authored-by: rsenden <[email protected]>
- Remove unused ExecutorService and thread pool parameter from JsonRpcServer
- Add validation for limit (must be > 0) and offset (must be >= 0) parameters
- Cache qualifiedName in local variable in filter lambda
- Use JsonRpcError.INTERNAL_ERROR constant in fallback error response

Co-authored-by: rsenden <[email protected]>
- Create shared _common/helper package with reusable components:
  - FcliRecordsCache: Background loading and caching for large result sets
  - FcliToolResult: Unified result class for fcli command execution
  - FcliRunnerHelper: Helper methods for running fcli commands

- Add new RPC methods for async execution and cache management:
  - fcli.executeAsync: Start background collection, returns cacheKey
  - fcli.getPage: Retrieve page from cache by cacheKey with wait option
  - fcli.cancelCollection: Cancel in-progress collection
  - fcli.clearCache: Clear cache entries

- Update documentation and tests for new methods

Co-authored-by: rsenden <[email protected]>
- Add fcli.ssc.login, fcli.ssc.logout for SSC sessions
- Add fcli.fod.login, fcli.fod.logout for FoD sessions
- Auto-logout all sessions when RPC server terminates
- Auto-add session options to commands based on product type
- Remove paging from fcli.execute (use async methods for large datasets)
- Improve argument quoting to prevent injection issues
- Fix logoutAll to avoid duplicate logout attempts
- Update documentation and tests

Co-authored-by: rsenden <[email protected]>
Per review feedback:
- Removed ci-token (equivalent to token)
- Added client-auth-token for SC-SAST authentication
- Added sc-sast-url for SC-SAST controller URL
- insecure mode already supported for both login methods

Co-authored-by: rsenden <[email protected]>
- Remove ci-token (now just use token for both UnifiedLoginToken and CIToken)
- Add client-auth-token and sc-sast-url for SC-SAST authentication
- Fix authentication note to reflect current implementation

Co-authored-by: rsenden <[email protected]>
…fcli' into sangamesh/latest-mcp-json-rpc-impl
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