Skip to content

Commit a72fd6b

Browse files
committed
MCP: Generate mcpb bundle
1 parent 0922826 commit a72fd6b

File tree

6 files changed

+12
-21
lines changed

6 files changed

+12
-21
lines changed

.github/workflows/geargrafx.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ jobs:
273273
mkdir -p mcpb/server
274274
mkdir -p mcpb/mcp/resources
275275
276-
# Copy icon
277-
cp platforms/macos/image.png mcpb/icon.png
276+
cp platforms/shared/desktop/mcp/icon.png mcpb/icon.png
278277
279278
if [ "${{ matrix.variant.platform }}" = "darwin" ]; then
280279
cd download

platforms/shared/desktop/application.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static bool input_gamepad_shortcut_prev[GG_MAX_GAMEPADS][config_HotkeyIndex_COUN
4949
static Uint32 mouse_last_motion_time = 0;
5050
static const Uint32 mouse_hide_timeout_ms = 1500;
5151

52-
bool g_mcp_server_active = false;
52+
bool g_mcp_stdio_mode = false;
5353

5454
static bool sdl_init(void);
5555
static void sdl_destroy(void);
7.25 KB
Loading

platforms/shared/desktop/mcp/manifest.json.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"long_description": "{{NAME_UPPER}} is a high-accuracy PC Engine (TurboGrafx-16) emulator with comprehensive debugging capabilities exposed through the Model Context Protocol. This MCP server allows AI assistants to debug, inspect, and control the emulator, providing tools for memory inspection, breakpoint management, register access, and hardware state monitoring.",
88
"author": {
99
"name": "Nacho Sanchez",
10-
"url": "https://x.com/drhelius"
10+
"url": "https://github.com/drhelius/Geargrafx"
1111
},
1212
"repository": {
1313
"type": "git",

platforms/shared/desktop/mcp/mcp_manager.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "mcp_transport.h"
2525
#include "mcp_debug_adapter.h"
2626

27-
extern bool g_mcp_server_active;
27+
extern bool g_mcp_stdio_mode;
2828

2929
enum McpTransportMode
3030
{
@@ -65,8 +65,6 @@ class McpManager
6565
if (m_server && m_server->IsRunning())
6666
return;
6767

68-
g_mcp_server_active = true;
69-
7068
McpTransportInterface* transport = NULL;
7169
if (m_transport_mode == MCP_TRANSPORT_TCP)
7270
{
@@ -75,7 +73,7 @@ class McpManager
7573
}
7674
else
7775
{
78-
Log("[MCP] Starting STDIO transport");
76+
g_mcp_stdio_mode = true;
7977
transport = new StdioTransport();
8078
}
8179

@@ -98,7 +96,7 @@ class McpManager
9896
m_server->GetTransport()->close();
9997

10098
SafeDelete(m_server);
101-
g_mcp_server_active = false;
99+
g_mcp_stdio_mode = false;
102100
}
103101
}
104102

src/log.h

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "libretro.h"
2929
extern retro_log_printf_t log_cb;
3030
#else
31-
extern bool g_mcp_server_active;
31+
extern bool g_mcp_stdio_mode;
3232
#endif
3333

3434
#if defined(GG_DEBUG)
@@ -65,18 +65,12 @@ inline void Log_func(const char* const msg, ...)
6565
return;
6666
}
6767
#else
68-
if (g_mcp_server_active)
69-
{
70-
fprintf(stderr, "%s\n", buffer);
71-
fflush(stderr);
68+
if (g_mcp_stdio_mode)
7269
return;
73-
}
74-
else
75-
{
76-
printf("%s\n", buffer);
77-
fflush(stdout);
78-
return;
79-
}
70+
71+
printf("%s\n", buffer);
72+
fflush(stdout);
73+
return;
8074
#endif
8175
}
8276

0 commit comments

Comments
 (0)