File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { getProxyBaseURL } from "@/lib";
1717import { capitalizeFirstLetter } from "@/lib" ;
1818import { useAuthStore } from "@/store/authStore" ;
1919import { useTranslation } from "react-i18next" ;
20+ import { GMAIL_CONFIG } from "@/pages/Setting/MCP" ;
2021interface McpItem {
2122 id : number ;
2223 name : string ;
@@ -56,6 +57,10 @@ const ToolSelect = forwardRef<
5657 proxyFetchGet ( "/api/config/info" ) . then ( ( res ) => {
5758 if ( res && typeof res === "object" ) {
5859 const baseURL = getProxyBaseURL ( ) ;
60+ if ( typeof res === "object" && res !== null ) {
61+ Object . assign ( res , GMAIL_CONFIG ) ;
62+ console . log ( "Modified config info with Gmail:" , res ) ;
63+ }
5964
6065 const list = Object . entries ( res )
6166 . filter ( ( [ key ] ) => {
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { Input } from "@/components/ui/input";
33import { Circle } from "lucide-react" ;
44import { useEffect , useState } from "react" ;
55import { proxyFetchGet , proxyFetchPost } from "@/api/http" ;
6+ import { GMAIL_CONFIG } from "./MCP" ;
67
78interface ConfigItem {
89 name : string ;
@@ -16,7 +17,11 @@ export default function SettingAPI() {
1617 const [ errors , setErrors ] = useState < Record < string , string > > ( { } ) ;
1718
1819 useEffect ( ( ) => {
19- proxyFetchGet ( "/api/config/info" ) . then ( ( res ) => {
20+ proxyFetchGet ( "/api/config/info" ) . then ( ( res ) => {
21+ if ( typeof res === "object" && res !== null ) {
22+ Object . assign ( res , GMAIL_CONFIG ) ;
23+ console . log ( "Modified config info with Gmail:" , res ) ;
24+ }
2025 const configs = Object . entries ( res || { } )
2126 . map ( ( [ name , v ] : [ string , any ] ) => ( { name, env_vars : v . env_vars } ) )
2227 . filter ( ( item ) => Array . isArray ( item . env_vars ) && item . env_vars . length > 0 ) ;
Original file line number Diff line number Diff line change @@ -24,6 +24,17 @@ import { useTranslation } from "react-i18next";
2424import { toast } from "sonner" ;
2525import { ConfigFile } from "electron/main/utils/mcpConfig" ;
2626
27+ export const GMAIL_CONFIG = {
28+ "Google Gmail" : {
29+ "env_vars" : [
30+ "GOOGLE_CLIENT_ID" ,
31+ "GOOGLE_CLIENT_SECRET" ,
32+ "GOOGLE_REFRESH_TOKEN"
33+ ] ,
34+ "toolkit" : "google_gmail_mcp_toolkit"
35+ }
36+ }
37+
2738export default function SettingMCP ( ) {
2839 const navigate = useNavigate ( ) ;
2940 const { checkAgentTool } = useAuthStore ( ) ;
@@ -109,6 +120,11 @@ export default function SettingMCP() {
109120 useEffect ( ( ) => {
110121 proxyFetchGet ( "/api/config/info" ) . then ( ( res ) => {
111122 if ( res && typeof res === "object" ) {
123+ if ( typeof res === "object" && res !== null ) {
124+ Object . assign ( res , GMAIL_CONFIG ) ;
125+ console . log ( "Modified config info with Gmail:" , res ) ;
126+ }
127+
112128 const baseURL = getProxyBaseURL ( ) ;
113129 const list = Object . entries ( res ) . map ( ( [ key , value ] : [ string , any ] ) => {
114130 let onInstall = null ;
You can’t perform that action at this time.
0 commit comments