2121# Test 1: Server starts without errors
2222echo " Testing server startup (5 second timeout)..."
2323if timeout 5 node " ${MCP_DIR} /src/index.js" < /dev/null 2>&1 | grep -q " Devbox MCP server running" ; then
24- TEST_PASS =$(( TEST_PASS + 1 ))
24+ test_passed =$(( test_passed + 1 ))
2525 echo " ✓ Server starts successfully"
2626else
27- TEST_FAIL =$(( TEST_FAIL + 1 ))
27+ test_failed =$(( test_failed + 1 ))
2828 echo " ✗ Server failed to start"
2929fi
3030
@@ -34,117 +34,117 @@ server_content="$(cat "${MCP_DIR}/src/index.js")"
3434
3535# devbox_run tool checks
3636if echo " $server_content " | grep -q ' name: "devbox_run"' ; then
37- TEST_PASS =$(( TEST_PASS + 1 ))
37+ test_passed =$(( test_passed + 1 ))
3838 echo " ✓ devbox_run tool defined"
3939else
40- TEST_FAIL =$(( TEST_FAIL + 1 ))
40+ test_failed =$(( test_failed + 1 ))
4141 echo " ✗ devbox_run tool not found"
4242fi
4343
4444if echo " $server_content " | grep -q ' command:' ; then
45- TEST_PASS =$(( TEST_PASS + 1 ))
45+ test_passed =$(( test_passed + 1 ))
4646 echo " ✓ devbox_run has command parameter"
4747else
48- TEST_FAIL =$(( TEST_FAIL + 1 ))
48+ test_failed =$(( test_failed + 1 ))
4949 echo " ✗ devbox_run missing command parameter"
5050fi
5151
5252# devbox_list tool checks
5353if echo " $server_content " | grep -q ' name: "devbox_list"' ; then
54- TEST_PASS =$(( TEST_PASS + 1 ))
54+ test_passed =$(( test_passed + 1 ))
5555 echo " ✓ devbox_list tool defined"
5656else
57- TEST_FAIL =$(( TEST_FAIL + 1 ))
57+ test_failed =$(( test_failed + 1 ))
5858 echo " ✗ devbox_list tool not found"
5959fi
6060
6161# devbox_add tool checks
6262if echo " $server_content " | grep -q ' name: "devbox_add"' ; then
63- TEST_PASS =$(( TEST_PASS + 1 ))
63+ test_passed =$(( test_passed + 1 ))
6464 echo " ✓ devbox_add tool defined"
6565else
66- TEST_FAIL =$(( TEST_FAIL + 1 ))
66+ test_failed =$(( test_failed + 1 ))
6767 echo " ✗ devbox_add tool not found"
6868fi
6969
7070if echo " $server_content " | grep -q ' packages:' ; then
71- TEST_PASS =$(( TEST_PASS + 1 ))
71+ test_passed =$(( test_passed + 1 ))
7272 echo " ✓ devbox_add has packages parameter"
7373else
74- TEST_FAIL =$(( TEST_FAIL + 1 ))
74+ test_failed =$(( test_failed + 1 ))
7575 echo " ✗ devbox_add missing packages parameter"
7676fi
7777
7878# devbox_info tool checks
7979if echo " $server_content " | grep -q ' name: "devbox_info"' ; then
80- TEST_PASS =$(( TEST_PASS + 1 ))
80+ test_passed =$(( test_passed + 1 ))
8181 echo " ✓ devbox_info tool defined"
8282else
83- TEST_FAIL =$(( TEST_FAIL + 1 ))
83+ test_failed =$(( test_failed + 1 ))
8484 echo " ✗ devbox_info tool not found"
8585fi
8686
8787# devbox_search tool checks
8888if echo " $server_content " | grep -q ' name: "devbox_search"' ; then
89- TEST_PASS =$(( TEST_PASS + 1 ))
89+ test_passed =$(( test_passed + 1 ))
9090 echo " ✓ devbox_search tool defined"
9191else
92- TEST_FAIL =$(( TEST_FAIL + 1 ))
92+ test_failed =$(( test_failed + 1 ))
9393 echo " ✗ devbox_search tool not found"
9494fi
9595
9696# devbox_docs_search tool checks
9797if echo " $server_content " | grep -q ' name: "devbox_docs_search"' ; then
98- TEST_PASS =$(( TEST_PASS + 1 ))
98+ test_passed =$(( test_passed + 1 ))
9999 echo " ✓ devbox_docs_search tool defined"
100100else
101- TEST_FAIL =$(( TEST_FAIL + 1 ))
101+ test_failed =$(( test_failed + 1 ))
102102 echo " ✗ devbox_docs_search tool not found"
103103fi
104104
105105if echo " $server_content " | grep -q ' maxResults' ; then
106- TEST_PASS =$(( TEST_PASS + 1 ))
106+ test_passed =$(( test_passed + 1 ))
107107 echo " ✓ devbox_docs_search has maxResults parameter"
108108else
109- TEST_FAIL =$(( TEST_FAIL + 1 ))
109+ test_failed =$(( test_failed + 1 ))
110110 echo " ✗ devbox_docs_search missing maxResults parameter"
111111fi
112112
113113# devbox_docs_list tool checks
114114if echo " $server_content " | grep -q ' name: "devbox_docs_list"' ; then
115- TEST_PASS =$(( TEST_PASS + 1 ))
115+ test_passed =$(( test_passed + 1 ))
116116 echo " ✓ devbox_docs_list tool defined"
117117else
118- TEST_FAIL =$(( TEST_FAIL + 1 ))
118+ test_failed =$(( test_failed + 1 ))
119119 echo " ✗ devbox_docs_list tool not found"
120120fi
121121
122122# devbox_docs_read tool checks
123123if echo " $server_content " | grep -q ' name: "devbox_docs_read"' ; then
124- TEST_PASS =$(( TEST_PASS + 1 ))
124+ test_passed =$(( test_passed + 1 ))
125125 echo " ✓ devbox_docs_read tool defined"
126126else
127- TEST_FAIL =$(( TEST_FAIL + 1 ))
127+ test_failed =$(( test_failed + 1 ))
128128 echo " ✗ devbox_docs_read tool not found"
129129fi
130130
131131if echo " $server_content " | grep -q ' filePath' ; then
132- TEST_PASS =$(( TEST_PASS + 1 ))
132+ test_passed =$(( test_passed + 1 ))
133133 echo " ✓ devbox_docs_read has filePath parameter"
134134else
135- TEST_FAIL =$(( TEST_FAIL + 1 ))
135+ test_failed =$(( test_failed + 1 ))
136136 echo " ✗ devbox_docs_read missing filePath parameter"
137137fi
138138
139139# Test 3: Check helper functions exist
140140echo " Checking helper functions..."
141- helper_functions=" runDevbox ensureDocsRepo searchDocs listDocs readDoc"
141+ helper_functions=" runDevbox fetchDocsList fetchRawContent searchDocs listDocs readDoc"
142142for func in $helper_functions ; do
143143 if echo " $server_content " | grep -q " function $func " ; then
144- TEST_PASS =$(( TEST_PASS + 1 ))
144+ test_passed =$(( test_passed + 1 ))
145145 echo " ✓ $func helper function defined"
146146 else
147- TEST_FAIL =$(( TEST_FAIL + 1 ))
147+ test_failed =$(( test_failed + 1 ))
148148 echo " ✗ $func helper function not found"
149149 fi
150150done
@@ -154,12 +154,12 @@ echo "Checking tool handlers..."
154154tools=" devbox_run devbox_list devbox_add devbox_info devbox_search devbox_docs_search devbox_docs_list devbox_docs_read devbox_init devbox_shell_env devbox_sync"
155155for tool in $tools ; do
156156 if echo " $server_content " | grep -q " case \" $tool \" :" ; then
157- TEST_PASS =$(( TEST_PASS + 1 ))
157+ test_passed =$(( test_passed + 1 ))
158158 echo " ✓ Handler exists for $tool "
159159 else
160- TEST_FAIL =$(( TEST_FAIL + 1 ))
160+ test_failed =$(( test_failed + 1 ))
161161 echo " ✗ Handler missing for $tool "
162162 fi
163163done
164164
165- test_summary
165+ test_summary " devbox-mcp-tools "
0 commit comments