Skip to content

Commit b4d319b

Browse files
Merge pull request #1047 from ashera96/mcp-support-v2
Add MCP Server Support for API Manager
2 parents 45de208 + 82840b0 commit b4d319b

File tree

141 files changed

+13856
-3041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+13856
-3041
lines changed

portals/devportal/src/main/webapp/.eslintrc.js

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ module.exports = {
2323
jsx: true,
2424
modules: true,
2525
},
26+
requireConfigFile: true,
2627
babelOptions: {
2728
presets: ['@babel/preset-react', '@babel/preset-typescript'],
29+
configFile: require.resolve('./babel.config.js'),
2830
},
2931
},
3032
env: {
@@ -36,7 +38,7 @@ module.exports = {
3638
},
3739
extends: ['airbnb', 'plugin:jsx-a11y/recommended'], // http://airbnb.io/javascript/react/
3840
rules: {
39-
"linebreak-style": 0,
41+
'linebreak-style': 0,
4042
'max-len': ['error', { code: 140, tabWidth: 4 }],
4143
'require-jsdoc': [
4244
'warn',
@@ -99,10 +101,37 @@ module.exports = {
99101
}],
100102
'react/sort-comp': [1],
101103
'react/jsx-props-no-spreading': [1, {
102-
exceptions:
103-
['Route', 'Operation', 'Listing', 'DeferredDetails', 'Details', 'svg', 'Paper', 'EditableRow', 'CreateScope', 'EditScope', 'WrappedComponent', 'ErrorIcon', 'WarningIcon', 'CheckCircleIcon', 'InfoIcon'],
104+
exceptions: [
105+
'Route',
106+
'Operation',
107+
'Listing',
108+
'DeferredDetails',
109+
'Details',
110+
'svg',
111+
'Paper',
112+
'EditableRow',
113+
'CreateScope',
114+
'EditScope',
115+
'WrappedComponent',
116+
'ErrorIcon',
117+
'WarningIcon',
118+
'CheckCircleIcon',
119+
'InfoIcon',
120+
],
104121
}],
105-
'react/prop-types': [1, { ignore: ['classes', 'api', 'theme', 'history', 'intl'] }], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
122+
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
123+
'react/prop-types': [
124+
1,
125+
{
126+
ignore: [
127+
'classes',
128+
'api',
129+
'theme',
130+
'history',
131+
'intl',
132+
],
133+
},
134+
],
106135
'react/destructuring-assignment': [1, 'always'],
107136
},
108137
plugins: ['react', 'jest', 'prettier'],

portals/devportal/src/main/webapp/WEB-INF/web.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
<url-pattern>/api-products/*</url-pattern>
104104
<url-pattern>/home/*</url-pattern>
105105
<url-pattern>/apis/*</url-pattern>
106+
<url-pattern>/mcp-servers/*</url-pattern>
106107
<url-pattern>/policy/*</url-pattern>
107108
<url-pattern>/apiGroups/*</url-pattern>
108109
<url-pattern>/sign-up/*</url-pattern>

portals/devportal/src/main/webapp/package-lock.json

Lines changed: 1516 additions & 816 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portals/devportal/src/main/webapp/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"@asyncapi/react-component": "^2.0.4",
3232
"@emotion/react": "^11.11.3",
3333
"@emotion/styled": "^11.11.0",
34-
"@hapi/joi": "^17.1.1",
3534
"@graphiql/plugin-explorer": "^3.0.3",
35+
"@hapi/joi": "^17.1.1",
3636
"@iconify/icons-simple-icons": "^1.0.52",
3737
"@iconify/react": "^1.1.3",
3838
"@mdi/js": "^6.9.96",
@@ -42,6 +42,7 @@
4242
"@mui/material": "^5.15.6",
4343
"@stoplight/elements": "^8.3.2",
4444
"@ui5/webcomponents-icons": "^1.9.3",
45+
"@wso2-org/mcp-playground": "^1.0.6",
4546
"ajv": "^8.12.0",
4647
"async-mutex": "^0.5.0",
4748
"autosuggest-highlight": "^3.3.4",

portals/devportal/src/main/webapp/site/public/css/main.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,4 +524,12 @@ a {
524524
margin: 0 0 20px;
525525
font-size: 17.5px;
526526
border-left: 5px solid #eee;
527-
}
527+
}
528+
529+
/* MCP Playground font family override to match portal theme */
530+
.mcp-playground,
531+
.mcp-playground *,
532+
[data-testid="mcp-playground"],
533+
[data-testid="mcp-playground"] * {
534+
font-family: "Open Sans", "Helvetica", "Arial", sans-serif !important;
535+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* MCP Playground font family override to match portal theme */
2+
.mcp-playground,
3+
.mcp-playground *,
4+
[data-testid="mcp-playground"],
5+
[data-testid="mcp-playground"] * {
6+
font-family: "Open Sans", "Helvetica", "Arial", sans-serif !important;
7+
}

portals/devportal/src/main/webapp/site/public/locales/en.json

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"ApiTryOut.SecurityDetailsPanel.btn.cancel": "Cancel",
3+
"ApiTryOut.SecurityDetailsPanel.btn.done": "Done",
4+
"ApiTryOut.SecurityDetailsPanel.title": "Security Configuration",
25
"Apis.Chat.Chat.Messages.subject.line": "API Marketplace Assistant is an early feature and can make mistakes. Verify its outputs.",
36
"Apis.Chat.ChatIcon.disable.chat.label": "Disable chat",
47
"Apis.Chat.ChatIcon.tooltip.label": "Open Chat",
@@ -27,9 +30,6 @@
2730
"Apis.Details.ApiChat.components.ApiChatResponse.executionResults": "Certainly! Here are the results of the API calls I executed on your behalf:",
2831
"Apis.Details.ApiChat.components.ApiChatResponse.loadingMessage": "Loading next execution step...",
2932
"Apis.Details.ApiChat.components.ApiChatResponse.terminatingMessage": "Execution is terminating...",
30-
"Apis.Details.ApiChat.components.ConfigureKeyDrawer.cancel": "Cancel",
31-
"Apis.Details.ApiChat.components.ConfigureKeyDrawer.done": "Done",
32-
"Apis.Details.ApiChat.components.ConfigureKeyDrawer.title": "Configure Key",
3333
"Apis.Details.ApiChat.components.CopyToClipboard.copiedText": "Copied",
3434
"Apis.Details.ApiChat.components.CopyToClipboard.copyText": "Copy to Clipboard",
3535
"Apis.Details.ApiChat.components.SampleQueryCard.executeButton": "Execute",
@@ -106,6 +106,7 @@
106106
"Apis.Details.AsyncApiConsole.Webhooks.secret": "Secret",
107107
"Apis.Details.Breadcrumb.comments": "Comments",
108108
"Apis.Details.Breadcrumb.documents": "Documents",
109+
"Apis.Details.Breadcrumb.mcp.playground": "MCP Playground",
109110
"Apis.Details.Breadcrumb.overview": "Overview",
110111
"Apis.Details.Breadcrumb.route.try.out": "Try Out",
111112
"Apis.Details.Breadcrumb.sdks": "SDKs",
@@ -314,7 +315,6 @@
314315
"Apis.Details.Swagger.URL.copied": "Copied",
315316
"Apis.Details.Swagger.URL.copy.to.clipboard": "Copy to clipboard",
316317
"Apis.Details.TryOutConsole.access.token.tooltip": "You can use your existing Access Token or you can generate a new Test Key.",
317-
"Apis.Details.index.all.apis": "ALL APIs",
318318
"Apis.Details.index.comments": "Comments",
319319
"Apis.Details.index.definition": "Definition",
320320
"Apis.Details.index.documentation": "Documents",
@@ -327,15 +327,8 @@
327327
"Apis.Details.index.try.out.": "Try Out",
328328
"Apis.Details.index.try.out.api.chat": "API Chat",
329329
"Apis.Details.index.try.out.api.console": "API Console",
330+
"Apis.Details.index.try.out.mcp.playground": "MCP Playground",
330331
"Apis.Details.protocols.and.endpoints": "Protocols & Endpoints",
331-
"Apis.Listing.APICardView.already.subscribed": "Subscribed",
332-
"Apis.Listing.APICardView.not.allowed": "Not Allowed",
333-
"Apis.Listing.APICardView.rows.per.page": "Rows per page",
334-
"Apis.Listing.APIList.id": "Id",
335-
"Apis.Listing.APIList.isSubscriptionAvailable": "Is Subscription Available",
336-
"Apis.Listing.APIList.name": "Name",
337-
"Apis.Listing.APIList.subscription.status": "Subscription Status",
338-
"Apis.Listing.APIList.version": "Version",
339332
"Apis.Listing.ApiBreadcrumbs.apigroups.main": "API Groups",
340333
"Apis.Listing.ApiTableView.business.owner.caption": "(Business Owner)",
341334
"Apis.Listing.ApiTableView.context": "Context",
@@ -367,7 +360,6 @@
367360
"Apis.Listing.DocThumb.apiVersion": "API Version",
368361
"Apis.Listing.DocThumb.sourceType": "Source Type:",
369362
"Apis.Listing.Listing.ApiTagCloud.title": "Tags / API Categories",
370-
"Apis.Listing.Listing.apis.main": "APIs",
371363
"Apis.Listing.NoApi.nodata.content": "There are no APIs to display right now.",
372364
"Apis.Listing.NoApi.nodata.title": "No APIs Available",
373365
"Apis.Listing.Recommendations.error.loading": "Error While Loading APIs",
@@ -439,32 +431,43 @@
439431
"Applications.Details.SubscriptionTableData.update.throttling.policy.rejected": "Subscription is currently REJECTED state. You need to get approval to the subscription before editing the tier",
440432
"Applications.Details.SubscriptionTableData.update.throttling.policy.tier.update": "Pending Tier Update :",
441433
"Applications.Details.SubscriptionTableData.update.throttling.policy.tierUpdatePending": "Subscription is currently TIER_UPDATE_PENDING state. You need to get approval to the existing subscription edit request before editing the tier",
442-
"Applications.Details.Subscriptions\n .business.plan": "Business Plan",
443-
"Applications.Details.Subscriptions\n .subscription.state": "Lifecycle State",
444434
"Applications.Details.Subscriptions.Status": "Subscription Status",
445435
"Applications.Details.Subscriptions.action": "Action",
446436
"Applications.Details.Subscriptions.api.name": "API",
447437
"Applications.Details.Subscriptions.api.webhooks": "Webhooks",
448438
"Applications.Details.Subscriptions.api.webhooks.delivery.time.unavailable": "Delivery data unavailable",
449439
"Applications.Details.Subscriptions.api.webhooks.subscriptions.unavailable": "No Webhook subscriptions available at this time.",
440+
"Applications.Details.Subscriptions.apis.add.subscription.button": "Subscribe",
441+
"Applications.Details.Subscriptions.business.plan": "Business Plan",
450442
"Applications.Details.Subscriptions.business.plan.updated": "Business Plan updated successfully!",
451443
"Applications.Details.Subscriptions.delete.success": "Subscription deleted successfully!",
452444
"Applications.Details.Subscriptions.error.occurred.during.subscription": "Error occurred during subscription",
453445
"Applications.Details.Subscriptions.error.occurred.during.subscription.not.201": "Error occurred during subscription",
454446
"Applications.Details.Subscriptions.error.occurred.webhook.subscription": "Error while retrieving webhook subscriptions",
455447
"Applications.Details.Subscriptions.error.when.updating": "Error occurred when updating subscription",
456448
"Applications.Details.Subscriptions.error.while.deleting": "Error occurred when deleting subscription",
449+
"Applications.Details.Subscriptions.filter.mcp.msg": "Filtered MCP Servers for",
457450
"Applications.Details.Subscriptions.filter.msg": "Filtered APIs for",
458451
"Applications.Details.Subscriptions.filter.msg.all.apis": "Displaying all APIs",
459-
"Applications.Details.Subscriptions.no.subscriptions": "No Subscriptions Available",
460-
"Applications.Details.Subscriptions.no.subscriptions.content": "No subscriptions are available for this Application",
452+
"Applications.Details.Subscriptions.filter.msg.all.mcp": "Displaying all MCP Servers",
453+
"Applications.Details.Subscriptions.mcp.server.name": "MCP Server",
454+
"Applications.Details.Subscriptions.mcp.servers.add.subscription.button": "Subscribe",
455+
"Applications.Details.Subscriptions.no.api.subscriptions": "No API Subscriptions Available",
456+
"Applications.Details.Subscriptions.no.api.subscriptions.content": "No API subscriptions are available for this Application",
457+
"Applications.Details.Subscriptions.no.mcp.subscriptions": "No MCP Server Subscriptions Available",
458+
"Applications.Details.Subscriptions.no.mcp.subscriptions.content": "No MCP server subscriptions are available for this Application",
461459
"Applications.Details.Subscriptions.request.created": "Subscription Deletion Request Created!",
462460
"Applications.Details.Subscriptions.search": "Search APIs",
461+
"Applications.Details.Subscriptions.search.mcp": "Search MCP Servers",
463462
"Applications.Details.Subscriptions.select.a.subscription.policy": "Select a subscription policy",
464463
"Applications.Details.Subscriptions.something.went.wrong": "Something went wrong while deleting the Subscription!",
465-
"Applications.Details.Subscriptions.subscription.management": "Subscription Management",
466-
"Applications.Details.Subscriptions.subscription.management.add": "Subscribe APIs",
464+
"Applications.Details.Subscriptions.subscribed.apis": "Subscribed APIs",
465+
"Applications.Details.Subscriptions.subscribed.mcp.servers": "Subscribed MCP Servers",
466+
"Applications.Details.Subscriptions.subscription.state": "Lifecycle State",
467+
"Applications.Details.Subscriptions.subscription.subscribe.apis": "Subscribe to API(s)",
468+
"Applications.Details.Subscriptions.subscription.subscribe.mcp.servers": "Subscribe to MCP Server(s)",
467469
"Applications.Details.Subscriptions.subscription.successful": "Subscription successful",
470+
"Applications.Details.Subscriptions.subscriptions": "Subscriptions",
468471
"Applications.Details.Subscriptions.wrong.with.subscription": "Something went wrong while updating the Subscription!",
469472
"Applications.Details.api.keys.title": "API Key",
470473
"Applications.Details.applications.all": "ALL APPs",
@@ -540,6 +543,7 @@
540543
"Base.Header.GlobalNavbar.menu.apis": "APIs",
541544
"Base.Header.GlobalNavbar.menu.applications": "Applications",
542545
"Base.Header.GlobalNavbar.menu.home": "Home",
546+
"Base.Header.GlobalNavbar.menu.mcpServers": "MCP Servers",
543547
"Base.Header.headersearch.HeaderSearch.search_api.tooltip": "Search APIs",
544548
"Base.Header.headersearch.HeaderSearch.tooltip.option0": "Content [ Default ]",
545549
"Base.Header.headersearch.HeaderSearch.tooltip.option1": "Name [ Syntax - name:xxxx ]",
@@ -586,12 +590,15 @@
586590
"GraphQL.Devportal.Tryout.Addtional.headers.help": "This configuration is used to add additional Headers.",
587591
"GraphQL.Devportal.Tryout.Addtional.headers.hide.group": "Hide group",
588592
"GraphQL.Devportal.Tryout.Addtional.headers.title.text": "Add additional headers",
593+
"HAlOn1": "Name",
594+
"I3b4hn": "Version",
589595
"LandingPage.ApisWithTag.invalid.tenant.domain": "Invalid tenant domain",
590596
"Login.RedirectToLogin.you.will.be.redirected.to": "You will be redirected to {page}",
591597
"LoginDenied.anonymousview": "Go To Public Portal",
592598
"LoginDenied.logout": "Logout",
593599
"LoginDenied.message": "You don't have sufficient privileges to access the Developer Portal.",
594600
"LoginDenied.title": "Error 403 : Forbidden",
601+
"Pgb3Xj": "Subscribed",
595602
"Settings.ChangePasswordForm.Cancel.Button.text": "Cancel",
596603
"Settings.ChangePasswordForm.Save.Button.text": "Save",
597604
"Settings.ChangePasswordForm.confirm.new.password": "Confirm new Password",
@@ -753,6 +760,8 @@
753760
"Shared.ConfirmDialog.please.confirm.sure": "Are you sure?",
754761
"TenantListing.title": "Tenant Developer Portals",
755762
"Throttling.Advanced.Delete.will.be.deleted": "will be deleted.",
763+
"VCZBMt": "Rows per page",
764+
"YgOCYk": "Not Allowed",
756765
"access.token": "Access Token",
757766
"api.console.gateway.heading": "Gateway",
758767
"api.console.gql.additional.headers": "Additional Headers",
@@ -773,8 +782,11 @@
773782
"application.productionKeys.oAuth.tokenGeneration.step2.description": "Obtain test token",
774783
"application.update.pending": "A request to update the application has been sent.",
775784
"enter.access.token": "Enter access Token",
785+
"j2RZ00": "Is Subscription Available",
786+
"kGGU2D": "Id",
776787
"notice": "Notice",
777788
"password": "Password",
789+
"qZLN4k": "Subscription Status",
778790
"solace.application.available.topics.heading": "Available Topics",
779791
"solace.application.available.topics.subheading": "Topics permitted to access from solace applications",
780792
"solace.application.topics.publish": "Publish Topics",

portals/devportal/src/main/webapp/source/src/app/AppRouts.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import Progress from 'AppComponents/Shared/Progress';
2424
import { useTheme } from '@mui/material';
2525

2626
const Apis = lazy(() => import('AppComponents/Apis/Apis' /* webpackChunkName: "Apis" */));
27+
const MCPServers = lazy(() => import('AppComponents/MCPServers/MCPServers' /* webpackChunkName: "MCPServers" */));
2728
const Landing = lazy(() => import('AppComponents/LandingPage/Landing' /* webpackChunkName: "Landing" */));
2829
const TagCloudListing = lazy(() => import('AppComponents/Apis/Listing/TagCloudListing' /* webpackChunkName: "TagCloudListing" */));
2930
const ChangePassword = lazy(() => import('AppComponents/Settings/ChangePassword/ChangePassword'));
@@ -64,6 +65,7 @@ function AppRouts(props) {
6465
<Route path='/home' component={Landing} />
6566
<Route path='/api-groups' component={TagCloudListing} />
6667
<Route path='/(apis|api-products)' component={Apis} />
68+
<Route path='/mcp-servers' component={MCPServers} />
6769
<Route
6870
path='/settings/change-password/'
6971
render={(localProps) => {

portals/devportal/src/main/webapp/source/src/app/components/Apis/Details/ApiChat/ApiChat.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ import { CircularProgress, Typography } from '@mui/material';
3636
import Utils from 'AppData/Utils';
3737
import AuthManager from 'AppData/AuthManager';
3838
import { fetchToCurl } from 'fetch-to-curl';
39+
import SecurityDetailsPanel from 'AppComponents/Shared/ApiTryOut/SecurityDetailsPanel';
3940
import ApiChatPoweredBy from './components/ApiChatPoweredBy';
4041
import ApiChatBanner from './components/ApiChatBanner';
4142
import ApiChatExecute from './components/ApiChatExecute';
42-
import ConfigureKeyDrawer from './components/ConfigureKeyDrawer';
4343
import SampleQueryCard from './components/SampleQueryCard';
4444
import ApiChatResponse from './components/ApiChatResponse';
4545

@@ -737,7 +737,7 @@ const ApiChat = () => {
737737
<Box className={classes.tryWithAiMain}>
738738
<Box sx={{ flexGrow: 1 }}>
739739
{apiChatEnabled && aiAuthTokenProvided && (
740-
<ConfigureKeyDrawer
740+
<SecurityDetailsPanel
741741
isDrawerOpen={configureKeyDrawerOpen}
742742
updateDrawerOpen={setConfigureKeyDrawerOpen}
743743
onConfigChange={handleConfigChange}

portals/devportal/src/main/webapp/source/src/app/components/Apis/Details/ApiConsole/ApiConsole.jsx

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import openapiToPostman from 'openapi-to-postmanv2';
3333
import FileCopyIcon from '@mui/icons-material/FileCopy';
3434
import Tooltip from '@mui/material/Tooltip';
3535
import CloudDownloadRounded from '@mui/icons-material/CloudDownloadRounded';
36+
import MCPTryOut from 'AppComponents/Apis/Details/MCPTryOut/MCPTryOut';
3637
import queryString from 'query-string';
3738
import Settings from 'Settings';
3839
import Utils from 'AppData/Utils';
@@ -512,6 +513,7 @@ class ApiConsole extends React.Component {
512513
const downloadSwagger = JSON.stringify({ ...swagger });
513514
const downloadLink = 'data:text/json;charset=utf-8, ' + encodeURIComponent(downloadSwagger);
514515
const fileName = 'swagger.json';
516+
const isMCPServersRoute = window.location.pathname.includes('/mcp-servers');
515517

516518
if (api == null || swagger == null) {
517519
return <Progress />;
@@ -615,7 +617,7 @@ class ApiConsole extends React.Component {
615617
/>
616618
</Grid>
617619

618-
{api.type !== 'SOAP' && (
620+
{api.type !== 'SOAP' && !isMCPServersRoute && (
619621
<Grid container>
620622
<Grid xs={7} item />
621623
<Grid xs={2} item>
@@ -671,15 +673,27 @@ class ApiConsole extends React.Component {
671673
</Grid>
672674
)}
673675
</Paper>
674-
<Paper className={classes.swaggerUIPaper}>
675-
<SwaggerUI
676-
api={this.state.api}
677-
accessTokenProvider={this.accessTokenProvider}
678-
spec={swaggerSpec}
679-
authorizationHeader={authorizationHeader}
680-
securitySchemeType={securitySchemeType}
681-
/>
682-
</Paper>
676+
{!isMCPServersRoute && (
677+
<Paper className={classes.swaggerUIPaper}>
678+
<SwaggerUI
679+
api={this.state.api}
680+
accessTokenProvider={this.accessTokenProvider}
681+
spec={swaggerSpec}
682+
authorizationHeader={authorizationHeader}
683+
securitySchemeType={securitySchemeType}
684+
/>
685+
</Paper>
686+
)}
687+
{isMCPServersRoute && (
688+
<Grid container className={classes.grid}>
689+
<MCPTryOut
690+
api={this.state.api}
691+
authorizationHeader={authorizationHeader}
692+
securitySchemeType={securitySchemeType}
693+
accessToken={productionAccessToken || sandboxAccessToken}
694+
/>
695+
</Grid>
696+
)}
683697
</Root>
684698
);
685699
}

0 commit comments

Comments
 (0)