diff --git a/mcp-server/src/static/repl.html b/mcp-server/src/static/repl.html
index 24f7620..8ced2bb 100644
--- a/mcp-server/src/static/repl.html
+++ b/mcp-server/src/static/repl.html
@@ -171,7 +171,7 @@
-
@@ -183,25 +183,26 @@
$(document).ready(function () {
let isExecuting = false;
let entryCounter = 1;
+ let lastCode = ""; // store the last executed code
// create the initial input entry
createNewEntry();
function createNewEntry() {
const entryId = `entry-${entryCounter}`;
+ const defaultCode = lastCode || "";
const entryHtml = `
-
-
In [${entryCounter}]:
-
-
- `;
+ `;
$("#repl-container").append(entryHtml);
@@ -327,6 +328,9 @@ return 'This will be the result';">
$codeInput.prop("readonly", true);
$(`#execute-btn-${entryNum}`).remove();
+ // store the code for the next entry
+ lastCode = code;
+
// create a new entry for the next input
createNewEntry();