132132 font-size : 1.5rem ;
133133 }
134134
135+ .code-block {
136+ position : relative;
137+ margin : 1rem 0 ;
138+ }
139+
135140 code {
136141 background-color : var (--code-bg );
137142 padding : 0.75rem 1rem ;
138143 border-radius : 8px ;
139144 font-family : 'Fira Code' , monospace;
140145 display : block;
141- margin : 1rem 0 ;
142146 overflow-x : auto;
143147 border-left : 3px solid var (--accent-color );
148+ padding-right : 40px ; /* Space for the copy button */
149+ }
150+
151+ .copy-button {
152+ position : absolute;
153+ top : 50% ;
154+ right : 10px ;
155+ transform : translateY (-50% );
156+ background-color : var (--accent-dark );
157+ color : var (--text-primary );
158+ border : none;
159+ border-radius : 4px ;
160+ padding : 4px 8px ;
161+ font-size : 0.8rem ;
162+ cursor : pointer;
163+ opacity : 0.7 ;
164+ transition : opacity 0.2s , background-color 0.2s ;
165+ }
166+
167+ .copy-button : hover {
168+ opacity : 1 ;
169+ background-color : var (--accent-color );
170+ }
171+
172+ .copy-success {
173+ background-color : var (--success ) !important ;
144174 }
145175
146176 .clients {
@@ -218,7 +248,10 @@ <h1>MCP</h1>
218248 < div class ="coming-soon ">
219249 < h2 > 🚀 Quick Installation</ h2 >
220250 < p > Install MCP with a single command:</ p >
221- < code > < span class ="command-prompt "> $</ span > curl -sSL https://getmcp.sh/install | bash</ code >
251+ < div class ="code-block ">
252+ < code > < span class ="command-prompt "> $</ span > curl -sSL https://getmcp.sh/install | bash</ code >
253+ < button class ="copy-button " data-command ="curl -sSL https://getmcp.sh/install | bash "> Copy</ button >
254+ </ div >
222255 < p > MCP Manager is a Homebrew-like service for managing Model Context Protocol (MCP) servers across clients.</ p >
223256 </ div >
224257
@@ -228,25 +261,37 @@ <h2>Available Features</h2>
228261 < div class ="feature ">
229262 < h3 > < span > 👥</ span > Client Management</ h3 >
230263 < p > Easily switch between and manage MCP clients:</ p >
231- < code > < span class ="command-prompt "> $</ span > mcp client claude-desktop</ code >
264+ < div class ="code-block ">
265+ < code > < span class ="command-prompt "> $</ span > mcp client claude-desktop</ code >
266+ < button class ="copy-button " data-command ="mcp client claude-desktop "> Copy</ button >
267+ </ div >
232268 </ div >
233269
234270 < div class ="feature ">
235271 < h3 > < span > 📋</ span > Server Listing</ h3 >
236272 < p > View all your installed MCP servers:</ p >
237- < code > < span class ="command-prompt "> $</ span > mcp list</ code >
273+ < div class ="code-block ">
274+ < code > < span class ="command-prompt "> $</ span > mcp list</ code >
275+ < button class ="copy-button " data-command ="mcp list "> Copy</ button >
276+ </ div >
238277 </ div >
239278
240279 < div class ="feature ">
241280 < h3 > < span > ⚙️</ span > Server Management</ h3 >
242281 < p > Control your MCP server processes with ease:</ p >
243- < code > < span class ="command-prompt "> $</ span > mcp server start my-server</ code >
282+ < div class ="code-block ">
283+ < code > < span class ="command-prompt "> $</ span > mcp server start my-server</ code >
284+ < button class ="copy-button " data-command ="mcp server start my-server "> Copy</ button >
285+ </ div >
244286 </ div >
245287
246288 < div class ="feature ">
247289 < h3 > < span > 🔀</ span > Server Toggling</ h3 >
248290 < p > Enable or disable servers for specific clients:</ p >
249- < code > < span class ="command-prompt "> $</ span > mcp toggle my-server</ code >
291+ < div class ="code-block ">
292+ < code > < span class ="command-prompt "> $</ span > mcp toggle my-server</ code >
293+ < button class ="copy-button " data-command ="mcp toggle my-server "> Copy</ button >
294+ </ div >
250295 </ div >
251296 </ div >
252297
@@ -255,13 +300,19 @@ <h2>Coming Soon</h2>
255300 < div class ="feature ">
256301 < h3 > < span > 🧩</ span > Simple Server Installation</ h3 >
257302 < p > Install MCP servers with a single command:</ p >
258- < code > < span class ="command-prompt "> $</ span > mcp install claude-config</ code >
303+ < div class ="code-block ">
304+ < code > < span class ="command-prompt "> $</ span > mcp install claude-config</ code >
305+ < button class ="copy-button " data-command ="mcp install claude-config "> Copy</ button >
306+ </ div >
259307 </ div >
260308
261309 < div class ="feature ">
262310 < h3 > < span > 🔍</ span > Server Discovery</ h3 >
263311 < p > Find available Model Context Protocol servers:</ p >
264- < code > < span class ="command-prompt "> $</ span > mcp search</ code >
312+ < div class ="code-block ">
313+ < code > < span class ="command-prompt "> $</ span > mcp search</ code >
314+ < button class ="copy-button " data-command ="mcp search "> Copy</ button >
315+ </ div >
265316 </ div >
266317 </ div >
267318
@@ -280,5 +331,45 @@ <h2>Supported Clients</h2>
280331 < p > © 2025 MCP Manager | < a href ="https://github.com/pathintegral-xyz/getmcp.sh "> GitHub</ a > </ p >
281332 </ footer >
282333 </ div >
334+
335+ < script >
336+ document . addEventListener ( 'DOMContentLoaded' , function ( ) {
337+ // Add click event listeners to all copy buttons
338+ const copyButtons = document . querySelectorAll ( '.copy-button' ) ;
339+
340+ copyButtons . forEach ( button => {
341+ button . addEventListener ( 'click' , function ( ) {
342+ // Get the command to copy from the data attribute
343+ const command = this . getAttribute ( 'data-command' ) ;
344+
345+ // Create a temporary textarea element to copy from
346+ const textarea = document . createElement ( 'textarea' ) ;
347+ textarea . value = command ;
348+ textarea . setAttribute ( 'readonly' , '' ) ;
349+ textarea . style . position = 'absolute' ;
350+ textarea . style . left = '-9999px' ;
351+ document . body . appendChild ( textarea ) ;
352+
353+ // Select and copy the text
354+ textarea . select ( ) ;
355+ document . execCommand ( 'copy' ) ;
356+
357+ // Remove the temporary textarea
358+ document . body . removeChild ( textarea ) ;
359+
360+ // Visual feedback that copy was successful
361+ const originalText = this . textContent ;
362+ this . textContent = 'Copied!' ;
363+ this . classList . add ( 'copy-success' ) ;
364+
365+ // Reset button after a delay
366+ setTimeout ( ( ) => {
367+ this . textContent = originalText ;
368+ this . classList . remove ( 'copy-success' ) ;
369+ } , 2000 ) ;
370+ } ) ;
371+ } ) ;
372+ } ) ;
373+ </ script >
283374</ body >
284375</ html >
0 commit comments