Skip to content

added api to fetchApprovedMcpServer#4832

Open
harshithb3304 wants to merge 3 commits intofeature/cyborg-releasefrom
feature/approvedMcpServer
Open

added api to fetchApprovedMcpServer#4832
harshithb3304 wants to merge 3 commits intofeature/cyborg-releasefrom
feature/approvedMcpServer

Conversation

@harshithb3304
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings April 15, 2026 12:11
Copy link
Copy Markdown
Contributor

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

Adds support for retrieving “approved MCP servers” from a new per-account MCP registry config via the database-abstractor API.

Changes:

  • Adds MCP_REGISTRY to ConfigType and introduces Config.McpRegistryConfig with registries and approvedServers fields.
  • Adds a new Struts action route api/fetchApprovedMcpServers.
  • Implements DbAction.fetchApprovedMcpServers() and exposes approvedMcpServers via getter/setter.

Reviewed changes

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

File Description
libs/dao/src/main/java/com/akto/dto/Config.java Introduces McpRegistryConfig and new ConfigType.MCP_REGISTRY.
apps/database-abstractor/src/main/resources/struts.xml Registers a new API action for fetching approved MCP servers.
apps/database-abstractor/src/main/java/com/akto/action/DbAction.java Implements the API handler and response field for approved MCP servers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

public String fetchApprovedMcpServers() {
try {
int accountId = Context.accountId.get();
String configId = accountId + "_MCP_REGISTRY";
Comment on lines +577 to +592
public String fetchApprovedMcpServers() {
try {
int accountId = Context.accountId.get();
String configId = accountId + "_MCP_REGISTRY";
Config.McpRegistryConfig mcpRegistryConfig = (Config.McpRegistryConfig) ConfigsDao.instance.findOne(
com.mongodb.client.model.Filters.eq("_id", configId)
);
if (mcpRegistryConfig != null) {
approvedMcpServers = mcpRegistryConfig.getApprovedServers();
}
} catch (Exception e) {
loggerMaker.errorAndAddToDb(e, "error in fetchApprovedMcpServers " + e.toString());
return Action.ERROR.toUpperCase();
}
return Action.SUCCESS.toUpperCase();
}

public McpRegistryConfig(int accountId) {
this.configType = ConfigType.MCP_REGISTRY;
this.id = accountId + "_MCP_REGISTRY";
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