Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ target/
*.local
java/project.properties
.admin/
.DS_Store
**/.DS_Store
**/.env
**/.env.*
!client/.env

# cache
Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
"$schema": "https://biomejs.dev/schemas/2.3.7/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
Binary file removed client/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion client/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file contains environment variables for the SEMOSS client application
ENDPOINT="http://localhost:9090/"
MODULE="/Monolith"
# CLIENT_APP="your-app-id" # In .env.local, this should be set to your specific app ID
# APP="your-app-id" # In .env.local, this should be set to your specific app ID
15 changes: 7 additions & 8 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,20 @@
"@emotion/styled": "^11.14.1",
"@mui/icons-material": "^7.3.5",
"@mui/material": "^7.3.5",
"@mui/x-data-grid": "^8.17.0",
"@mui/x-date-pickers": "^8.17.0",
"@mui/x-data-grid": "^8.19.0",
"@mui/x-date-pickers": "^8.19.0",
"@semoss/sdk": "1.0.0-beta.31",
"@semoss/sdk-react": "1.0.0-beta.20",
"dayjs": "^1.11.19",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^7.9.5"
"react-router-dom": "^7.9.6"
},
"devDependencies": {
"@types/node": "^24.10.0",
"@types/react": "^18.3.26",
"@types/node": "^24.10.1",
"@types/react": "^18.3.27",
"@types/react-dom": "^18.3.7",
"@vitejs/plugin-react": "^5.1.0",
"@vitejs/plugin-react": "^5.1.1",
"typescript": "^5.9.3",
"vite": "^7.2.2"
"vite": "^7.2.4"
}
}
480 changes: 232 additions & 248 deletions client/pnpm-lock.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CssBaseline, ThemeProvider } from "@mui/material";
import { LocalizationProvider } from "@mui/x-date-pickers";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import { Env } from "@semoss/sdk";
import { InsightProvider } from "@semoss/sdk-react";
import { InsightProvider } from "@semoss/sdk/react";
import { AppContextProvider } from "./contexts";
import { Router } from "./pages";
import { THEME } from "./theme";
Expand All @@ -11,7 +11,7 @@ Env.update({
MODULE: import.meta.env.MODULE || "",
ACCESS_KEY: import.meta.env.CLIENT_ACCESS_KEY || "", // undefined in production
SECRET_KEY: import.meta.env.CLIENT_SECRET_KEY || "", // undefined in production
APP: import.meta.env.CLIENT_APP || "",
APP: import.meta.env.APP || "",
});

/**
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/base/MainNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Typography,
useTheme,
} from "@mui/material";
import { useInsight } from "@semoss/sdk-react";
import { useInsight } from "@semoss/sdk/react";
import { useState } from "react";
import { useNavigate } from "react-router-dom";
import { SemossBlueLogo } from "@/assets";
Expand Down
38 changes: 36 additions & 2 deletions client/src/contexts/AppContext.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getSystemConfig, runPixel as runPixelSemossSdk } from "@semoss/sdk";
import { useInsight } from "@semoss/sdk-react";
import { useInsight } from "@semoss/sdk/react";
import {
createContext,
type Dispatch,
Expand All @@ -18,6 +18,11 @@ export interface AppContextType {
pixelString: string,
successMessage?: string,
) => Promise<T>;
runMCPTool: (
toolName: string,
toolInput?: Record<string, unknown>,
successMessage?: string,
) => Promise<string>;
login: (username: string, password: string) => Promise<boolean>;
logout: () => Promise<boolean>;
userLoginName: string;
Expand Down Expand Up @@ -73,7 +78,11 @@ export const AppContextProvider = ({ children }: PropsWithChildren) => {
* Functions
*/

// Function to run a pixel and return the result. Opens the snackbar if there is an error.
/**
* Run pixel code
* @param pixelString - the pixel string to run
* @param successMessage - optional parameter to show a success message
*/
const runPixel = useCallback(
async <T,>(pixelString: string, successMessage?: string) => {
try {
Expand Down Expand Up @@ -120,6 +129,30 @@ export const AppContextProvider = ({ children }: PropsWithChildren) => {
[insightId],
);

/**
* Run a MCP tool
* @param name - name of the tool
* @param parameters - parameters to pass to the tool
*/
const runMCPTool = useCallback(
async (name: string, parameters?: Record<string, unknown>) => {
try {
const response = await actions.runMCPTool(name, parameters);
if (!response.output)
throw new Error("No output from MCP tool");
return response.output;
} catch (error) {
setMessageSnackbarProps({
open: true,
message: `${error.message ?? "Error during operation"}`,
severity: "error",
});
throw error;
}
},
[actions],
);

// Allow users to log in, and grab their name when they do
const login = useCallback(
async (username: string, password: string) => {
Expand Down Expand Up @@ -213,6 +246,7 @@ export const AppContextProvider = ({ children }: PropsWithChildren) => {
<AppContext.Provider
value={{
runPixel,
runMCPTool,
exampleStateData,
isAppDataLoading,
messageSnackbarProps,
Expand Down
2 changes: 1 addition & 1 deletion client/src/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ interface ImportMetaEnv {
readonly MODULE: string;
readonly CLIENT_ACCESS_KEY: string;
readonly CLIENT_SECRET_KEY: string;
readonly CLIENT_APP: string;
readonly APP: string;
// more env variables...
}

Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/LoginPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button, Stack, TextField } from "@mui/material";
import { useInsight } from "@semoss/sdk-react";
import { useInsight } from "@semoss/sdk/react";
import { type ChangeEvent, useRef, useState } from "react";
import { Navigate, useLocation } from "react-router-dom";
import { useAppContext } from "@/contexts";
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/layouts/AuthorizedLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useInsight } from "@semoss/sdk-react";
import { useInsight } from "@semoss/sdk/react";
import { Navigate, Outlet, useLocation } from "react-router-dom";
import { LoadingScreen } from "@/components";
import { useAppContext } from "@/contexts";
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/layouts/InitializedLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Stack } from "@mui/material";
import { useInsight } from "@semoss/sdk-react";
import { useInsight } from "@semoss/sdk/react";
import { Outlet } from "react-router-dom";
import { LoadingScreen, MainNavigation, MessageSnackbar } from "@/components";
import { useAppContext } from "@/contexts";
Expand Down
2 changes: 1 addition & 1 deletion client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
Expand Down
4 changes: 3 additions & 1 deletion client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { resolve } from "node:path";
import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
import { defineConfig, loadEnv } from "vite";

export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "") as {
ENDPOINT: string;
MODULE: string;
APP: string;
};

return {
Expand All @@ -21,6 +22,7 @@ export default defineConfig(({ mode }) => {
define: {
"import.meta.env.ENDPOINT": JSON.stringify(env.ENDPOINT),
"import.meta.env.MODULE": JSON.stringify(env.MODULE),
"import.meta.env.APP": JSON.stringify(env.APP),
},
server: {
proxy: {
Expand Down
41 changes: 41 additions & 0 deletions java/src/reactors/examples/OpenMCPAppReactor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package reactors.examples;

import prerna.sablecc2.om.PixelDataType;
import prerna.sablecc2.om.nounmeta.NounMetadata;
import reactors.AbstractProjectReactor;

/**
* Dummy reactor that allows Playground to open the MCP App interface.
*
* @see {@link AbstractProjectReactor} for base reactor functionality
*/
public class OpenMCPAppReactor extends AbstractProjectReactor {

/** Constructs a OpenMCPAppReactor. This constructor does not expect any input parameters. */
public OpenMCPAppReactor() {
// list of keys the reactor is expecting
this.keysToGet = new String[] {};

// 1 for required keys, 0 for optional
this.keyRequired = new int[] {};
}

/**
* Executes the main logic of the OpenMCPAppReactor to return a default message. This method
* currently serves as a placeholder and returns a constant string indicating that the
* auto-execute response has not yet been implemented.
*
* @return A {@link NounMetadata} containing the greeting message as a constant string
*/
@Override
protected NounMetadata doExecute() {
return new NounMetadata(
"This MCP tool's auto-execute response has not yet been implemented.",
PixelDataType.CONST_STRING);
}

@Override
public String getReactorDescription() {
return "This tool allows the user to interact with the SEMOSS Template application.";
}
}
17 changes: 17 additions & 0 deletions mcp/pixel_mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"_meta": { "last_modified_date": "2025-11-24" },
"tools": [
{
"inputSchema": {
"type": "object",
"title": "OpenMCPApp_Arguments",
"properties": {},
"required": []
},
"name": "OpenMCPApp",
"description": "This tool allows the user to interact with the SEMOSS Template application.",
"_meta": { "SMSS_MCP_EXECUTION": "ask" },
"title": "Open MCP App"
}
]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"javadoc": "mvn clean javadoc:javadoc && mvn site && pnpm exec http-server target/site/apidocs -p 1227 -a localhost -o"
},
"devDependencies": {
"@biomejs/biome": "2.3.4",
"@biomejs/biome": "2.3.7",
"http-server": "^14.1.1",
"husky": "^9.1.7",
"lint-staged": "^16.2.6"
"lint-staged": "^16.2.7"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx,json,html,css}": [
Expand Down
Loading